cmd_sign/rwsig: Free sign_option.prikey in the main function

It's better to free it in the same function as it was allocated.

BRANCH=none
BUG=none
TEST=make runtests

Change-Id: I7a224364c4b1afce5a274b944d32fc1b7ba5db30
Reviewed-on: https://chromium-review.googlesource.com/446177
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Nicolas Boichat
2017-02-22 14:08:02 +08:00
committed by chrome-bot
parent b1b5cf7ee8
commit dec50797af
2 changed files with 2 additions and 2 deletions

View File

@@ -1051,6 +1051,8 @@ done:
free(sign_option.keyblock);
if (sign_option.kernel_subkey)
free(sign_option.kernel_subkey);
if (sign_option.prikey)
vb2_private_key_free(sign_option.prikey);
if (errorcnt)
fprintf(stderr, "Use --help for usage instructions\n");

View File

@@ -212,8 +212,6 @@ int ft_sign_rwsig(const char *name, uint8_t *buf, uint32_t len, void *data)
done:
if (sig)
free(sig);
if (sign_option.prikey)
vb2_private_key_free(sign_option.prikey);
return retval;
}