Free keys after use

Change-Id: I16ba4420ffeb9aa439e0a09a1b34d2aba2e1eb6e
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
This commit is contained in:
Jimmy Brisson 2020-07-27 10:43:40 -05:00 committed by Manish Pandey
parent bea8019826
commit 1f111f12b5
1 changed files with 7 additions and 0 deletions

View File

@ -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