From 33a23fa6afe355304e02b7abb96acdbc5fc6c5c2 Mon Sep 17 00:00:00 2001 From: mrpre Date: Tue, 1 Sep 2015 20:42:06 +0800 Subject: [PATCH 1/1] free item after sk_push fail Signed-off-by: Rich Salz Reviewed-by: Kurt Roeckx --- crypto/asn1/tasn_dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c index 595c5e4cb1..0e0759f54b 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; } } -- 2.34.1