Fix potential memory leak in KeyBlockVerify()
BUG=none
TEST=none
Change-Id: I17f1cff7d6f750dfd862d71941c6b8cfec57b6bf
Reviewed-on: https://gerrit.chromium.org/gerrit/22312
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
diff --git a/firmware/lib/vboot_common.c b/firmware/lib/vboot_common.c
index e074d61..7878701 100644
--- a/firmware/lib/vboot_common.c
+++ b/firmware/lib/vboot_common.c
@@ -280,6 +280,7 @@
/* Make sure advertised signature data sizes are sane. */
if (block->key_block_size < sig->data_size) {
VBDEBUG(("Signature calculated past end of the block\n"));
+ RSAPublicKeyFree(rsa);
return VBOOT_KEY_BLOCK_INVALID;
}