From 091fc71c74020d2f423d4aa6f40f6a04f4502fac Mon Sep 17 00:00:00 2001 From: Satoshi Yamaguchi Date: Wed, 17 Aug 2022 01:03:09 +0900 Subject: [PATCH] Fix EVP_PKEY not freed and FILE pointer not closed --- tests/api.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/api.c b/tests/api.c index d766b69e6..77a8f9c58 100644 --- a/tests/api.c +++ b/tests/api.c @@ -32003,6 +32003,7 @@ static int test_wolfSSL_PEM_read_PUBKEY(void) file = XFOPEN(fname, "rb"); AssertTrue(file != XBADFILE); AssertNotNull(pkey = PEM_read_PUBKEY(file, NULL, NULL, NULL)); + EVP_PKEY_free(pkey); XFCLOSE(file); #endif @@ -32490,6 +32491,7 @@ static int test_wolfSSL_PEM_read_RSA_PUBKEY(void) AssertNotNull((rsa = PEM_read_RSA_PUBKEY(file, NULL, NULL, NULL))); AssertIntEQ(RSA_size(rsa), 256); RSA_free(rsa); + XFCLOSE(file); #endif /* defined(OPENSSL_EXTRA) && !defined(NO_CERTS) */ return 0;