From 1df112448b41c3568477f3fcd3b8fc820ce80066 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sat, 8 Nov 2014 11:41:13 -0500 Subject: [PATCH] Fix memory leak in ssl3_send_client_key_exchange error handling. Change-Id: I0f0d7a3d4cb6448582ae4945e732611bb9bf5d9f Reviewed-on: https://boringssl-review.googlesource.com/2231 Reviewed-by: Adam Langley --- ssl/s3_clnt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 36f82bc8..54dbbd71 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -1943,6 +1943,8 @@ int ssl3_send_client_key_exchange(SSL *s) (pkey->pkey.rsa == NULL)) { OPENSSL_PUT_ERROR(SSL, ssl3_send_client_key_exchange, ERR_R_INTERNAL_ERROR); + if (pkey != NULL) + EVP_PKEY_free(pkey); goto err; } rsa=pkey->pkey.rsa;