From: Matt Caswell Date: Thu, 5 May 2016 08:35:10 +0000 (+0100) Subject: Fix a double free in tls1_setup_key_block X-Git-Tag: OpenSSL_1_0_2i~182 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ec8f246e6ed4d39a8a5417078eaa49f3e757c25d;p=oweals%2Fopenssl.git Fix a double free in tls1_setup_key_block If p2 == NULL then p1 can get freed twice and a crash could occur. Issue reported by Shi Lei (Qihoo 360 Inc) Reviewed-by: Viktor Dukhovni --- diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 514fcb3e4e..b6d1ee95a5 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -673,7 +673,6 @@ int tls1_setup_key_block(SSL *s) if ((p2 = (unsigned char *)OPENSSL_malloc(num)) == NULL) { SSLerr(SSL_F_TLS1_SETUP_KEY_BLOCK, ERR_R_MALLOC_FAILURE); - OPENSSL_free(p1); goto err; } #ifdef TLS_DEBUG