From: Istvan Noszticzius Date: Fri, 15 Aug 2014 15:43:28 +0000 (+0100) Subject: Fix use after free bug. X-Git-Tag: OpenSSL_1_0_2-beta3~106 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=beeb0fa7bede3f9d1552c86d81a038ae5b5fb9f9;p=oweals%2Fopenssl.git Fix use after free bug. Reviewed-by: Stephen Henson Reviewed-by: Emilia Käsper (cherry picked from commit 5afa57fb7b17aa51cfba1ffa94e900fc7a5f0e04) --- 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; }