aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJimmy Brisson <jimmy.brisson@arm.com>2020-07-27 10:43:40 -0500
committerManish Pandey <manish.pandey2@arm.com>2020-10-20 20:17:29 +0000
commit1f111f12b5ecc69670653763512e557f59f88ef9 (patch)
tree563a92c40a5a8dffc846dd57d51c16ff9e7e6cad /tools
parentbea8019826f97546e18265d3d7b8e54dfa7da250 (diff)
downloadtrusted-firmware-a-1f111f12b5ecc69670653763512e557f59f88ef9.tar.gz
Free keys after use
Change-Id: I16ba4420ffeb9aa439e0a09a1b34d2aba2e1eb6e Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/cert_create/src/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/cert_create/src/main.c b/tools/cert_create/src/main.c
index 368493a882..31978a9950 100644
--- a/tools/cert_create/src/main.c
+++ b/tools/cert_create/src/main.c
@@ -581,6 +581,13 @@ int main(int argc, char *argv[])
}
}
+ /* If we got here, then we must have filled the key array completely.
+ * We can then safely call free on all of the keys in the array
+ */
+ for (i = 0; i < num_keys; i++) {
+ EVP_PKEY_free(keys[i].key);
+ }
+
#ifndef OPENSSL_NO_ENGINE
ENGINE_cleanup();
#endif