Preliminary fix of memory leak in try_decode_PKCS12() - full fix is in #11733
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Tue, 12 May 2020 08:14:00 +0000 (10:14 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Wed, 13 May 2020 17:42:00 +0000 (19:42 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/11470)

crypto/store/loader_file.c

index 9f6158f..320c527 100644 (file)
@@ -278,6 +278,7 @@ static OSSL_STORE_INFO *try_decode_PKCS12(const char *pem_name,
                         (void)sk_X509_shift(chain);
                     }
                 }
+                sk_X509_free(chain);
                 if (!ok) {
                     OSSL_STORE_INFO_free(osi_ca);
                     OSSL_STORE_INFO_free(osi_cert);