Fix EVP_PKEY not freed and FILE pointer not closed

This commit is contained in:
Satoshi Yamaguchi
2022-08-17 01:03:09 +09:00
parent 524f9ebd32
commit 091fc71c74

View File

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