From: mrpre Date: Tue, 1 Sep 2015 12:42:06 +0000 (+0800) Subject: free item after sk_push fail X-Git-Tag: OpenSSL_1_1_0-pre3~442 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33a23fa6afe355304e02b7abb96acdbc5fc6c5c2;p=thirdparty%2Fopenssl.git free item after sk_push fail Signed-off-by: Rich Salz Reviewed-by: Kurt Roeckx --- diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c index 595c5e4cb18..0e0759f54bf 100644 --- a/crypto/asn1/tasn_dec.c +++ b/crypto/asn1/tasn_dec.c @@ -623,6 +623,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val, len -= p - q; if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) { ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_MALLOC_FAILURE); + ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item)); goto err; } }