Fix error-path memory leak in asn_mime.c
authorTodd Short <tshort@akamai.com>
Mon, 22 Jan 2018 19:30:24 +0000 (14:30 -0500)
committerMatt Caswell <matt@openssl.org>
Wed, 24 Jan 2018 18:23:33 +0000 (18:23 +0000)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5142)

(cherry picked from commit a26dd465b21d8def440c16b6bd90227b03e12e02)

crypto/asn1/asn_mime.c

index d7ec801b1e779948f98cd4660402f5a085b475ab..e18cacb83c68f7166b79350ba9520cefa68f2b32 100644 (file)
@@ -425,6 +425,7 @@ ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it)
             || hdr->value == NULL) {
             sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
             ASN1err(ASN1_F_SMIME_READ_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE);
+            sk_BIO_pop_free(parts, BIO_vfree);
             return NULL;
         }