From 837e1b6812d53799cff304630bc3a1a9db86b696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodo=20M=C3=B6ller?= Date: Mon, 5 Sep 2011 09:57:20 +0000 Subject: Fix memory leak on bad inputs. --- crypto/asn1/x_name.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crypto/asn1') diff --git a/crypto/asn1/x_name.c b/crypto/asn1/x_name.c index 063bf7c16b..49be08b4da 100644 --- a/crypto/asn1/x_name.c +++ b/crypto/asn1/x_name.c @@ -214,7 +214,9 @@ static int x509_name_ex_d2i(ASN1_VALUE **val, *val = nm.a; *in = p; return ret; - err: +err: + if (nm.x != NULL) + X509_NAME_free(nm.x); ASN1err(ASN1_F_X509_NAME_EX_D2I, ERR_R_NESTED_ASN1_ERROR); return 0; } -- cgit v1.2.3