free item after sk_push fail
authormrpre <mrpre@163.com>
Tue, 1 Sep 2015 12:42:06 +0000 (20:42 +0800)
committerRich Salz <rsalz@openssl.org>
Sat, 23 Jan 2016 18:48:10 +0000 (13:48 -0500)
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
crypto/asn1/tasn_dec.c

index 595c5e4..0e0759f 100644 (file)
@@ -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;
             }
         }