free item after sk_push fail

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
This commit is contained in:
mrpre 2015-09-01 20:42:06 +08:00 committed by Rich Salz
parent b427401cb6
commit 33a23fa6af

View 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;
}
}