Commit cdc3307d authored by Richard Levitte's avatar Richard Levitte
Browse files

asn1_item_embed_new(): don't free an embedded item



An embedded item wasn't allocated separately on the heap, so don't
free it as if it was.

Issue discovered by Pavel Kopyl

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4571)
parent 8c610178
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -199,6 +199,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
    return 1;

 memerr2:
    if (!combine)
        ASN1_item_ex_free(pval, it);
 memerr:
    ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ERR_R_MALLOC_FAILURE);
@@ -209,6 +210,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
    return 0;

 auxerr2:
    if (!combine)
        ASN1_item_ex_free(pval, it);
 auxerr:
    ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ASN1_R_AUX_ERROR);