]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
pkcs12: free PKCS7 elements on error in PKCS12_unpack_authsafes
authorNaveed Khan <dxbnaveed.k@gmail.com>
Sat, 4 Jul 2026 17:09:47 +0000 (22:39 +0530)
committerTomas Mraz <tomas@openssl.foundation>
Fri, 10 Jul 2026 15:48:31 +0000 (17:48 +0200)
Fixes: b536880c4572 "Add library context and property query support into the PKCS12 API"
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Jul 10 15:48:37 2026
(Merged from https://github.com/openssl/openssl/pull/31862)

crypto/pkcs12/p12_add.c

index 8ea41676d80ff80936909b6bd229288765ce9f67..12173177837776fec1d3e7c0453a3ef44d808b96 100644 (file)
@@ -219,6 +219,6 @@ STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12)
     }
     return p7s;
 err:
-    sk_PKCS7_free(p7s);
+    sk_PKCS7_pop_free(p7s, PKCS7_free);
     return NULL;
 }