Fix error-path memory leak in asn_mime.c
[openssl.git] / crypto / asn1 / asn_mime.c
index 936c8a5b009eaeef785220feb92e2c6e80cc7c8d..2faff455c54e25f5e87d97f8d09f236c3211c235 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;
         }