From 865886553dfb842464600e76b6e8f127b377a1ca Mon Sep 17 00:00:00 2001 From: Istvan Noszticzius Date: Fri, 15 Aug 2014 16:43:28 +0100 Subject: [PATCH] Fix use after free bug. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Stephen Henson Reviewed-by: Emilia Käsper --- crypto/x509v3/v3_utl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c index 75efd9912a..10a7aa876a 100644 --- a/crypto/x509v3/v3_utl.c +++ b/crypto/x509v3/v3_utl.c @@ -879,9 +879,9 @@ static int do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, if (astrlen < 0) return -1; rv = equal(astr, astrlen, (unsigned char *)b, blen, flags); - OPENSSL_free(astr); if (rv > 0 && peername) *peername = BUF_strndup((char *)astr, astrlen); + OPENSSL_free(astr); } return rv; }