From 1f111f12b5ecc69670653763512e557f59f88ef9 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Mon, 27 Jul 2020 10:43:40 -0500 Subject: Free keys after use Change-Id: I16ba4420ffeb9aa439e0a09a1b34d2aba2e1eb6e Signed-off-by: Jimmy Brisson --- tools/cert_create/src/main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools') diff --git a/tools/cert_create/src/main.c b/tools/cert_create/src/main.c index 368493a88..31978a995 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 -- cgit v1.2.3