free headers after use in error message
authorDr. Stephen Henson <steve@openssl.org>
Mon, 27 Feb 2012 16:27:00 +0000 (16:27 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 27 Feb 2012 16:27:00 +0000 (16:27 +0000)
crypto/asn1/asn_mime.c

index dc2a35d0c8cdb38f5c1301a74551ed653ce7b921..42536f77e30c290b2c25dfb0a749f60be503807d 100644 (file)
@@ -486,9 +486,9 @@ ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it)
 
                if(strcmp(hdr->value, "application/x-pkcs7-signature") &&
                        strcmp(hdr->value, "application/pkcs7-signature")) {
-                       sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
                        ASN1err(ASN1_F_SMIME_READ_ASN1,ASN1_R_SIG_INVALID_MIME_TYPE);
                        ERR_add_error_data(2, "type: ", hdr->value);
+                       sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
                        sk_BIO_pop_free(parts, BIO_vfree);
                        return NULL;
                }