summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-05-05 09:35:10 +0100
committerMatt Caswell <matt@openssl.org>2016-05-19 20:55:55 +0100
commitec8f246e6ed4d39a8a5417078eaa49f3e757c25d (patch)
tree729b07897cf8e19533ea21eaffa24a6ca09cd55e
parentb1d7eaaccfeece198c268912ec015a089fdaed39 (diff)
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 <viktor@openssl.org>
-rw-r--r--ssl/t1_enc.c1
1 files changed, 0 insertions, 1 deletions
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