X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fasn1%2Ftasn_fre.c;h=1e778858ac13879e5877438554e3b430387d8734;hp=bd955d98489859aec1ce93bf226ce8321282c5d5;hb=44c734e95c4242af5ccfd7e5c4653eb196705cb9;hpb=8314146ac57059f6d4095ef23e30ccdeb4699938;ds=sidebyside diff --git a/crypto/asn1/tasn_fre.c b/crypto/asn1/tasn_fre.c index bd955d9848..1e778858ac 100644 --- a/crypto/asn1/tasn_fre.c +++ b/crypto/asn1/tasn_fre.c @@ -125,8 +125,10 @@ static void asn1_item_embed_free(ASN1_VALUE **pval, const ASN1_ITEM *it, } if (asn1_cb) asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL); - OPENSSL_free(*pval); - *pval = NULL; + if (embed == 0) { + OPENSSL_free(*pval); + *pval = NULL; + } break; case ASN1_ITYPE_EXTERN: