Skip to content

Commit

Permalink
Fix last memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
WillChilds-Klein committed Jul 25, 2024
1 parent 3abe363 commit 28ca61f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crypto/pkcs7/pkcs7_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,8 @@ TEST(PKCS7Test, GettersSetters) {
bssl::UniquePtr<EVP_PKEY> rsa_pkey(EVP_PKEY_new());
ASSERT_TRUE(rsa_pkey);
ASSERT_TRUE(EVP_PKEY_set1_RSA(rsa_pkey.get(), rsa.get()));
X509 *rsa_x509 = sk_X509_value(certs.get(), 0u);
X509 *rsa_x509 = sk_X509_pop(certs.get());
ASSERT_EQ(0U, sk_X509_num(certs.get()));
ASSERT_TRUE(rsa_x509);
p7si = PKCS7_SIGNER_INFO_new();
ASSERT_TRUE(p7si);
Expand Down Expand Up @@ -2100,4 +2101,8 @@ TEST(PKCS7Test, GettersSetters) {
PKCS7_RECIP_INFO_get0_alg(p7ri, &penc);
ASSERT_TRUE(penc);
EXPECT_TRUE(PKCS7_add_recipient_info(p7_ri.get(), p7ri));

// "free" once to down-ref, second to actualy free
X509_free(rsa_x509);
X509_free(rsa_x509);
}

0 comments on commit 28ca61f

Please sign in to comment.