From 1b0286a385aae88068af796d6d0f4fe907fe66eb Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 5 Dec 2016 17:31:37 +0000 Subject: [PATCH] Fix a memory leak When we call tls_collect_extensions() we need to free up the raw extensions data later. Perl changes reviewed by Richard Levitte. Non-perl changes reviewed by Rich Salz Reviewed-by: Rich Salz Reviewed-by: Richard Levitte --- ssl/statem/statem_clnt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index c47c9aa518..38b8ecb290 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -1352,10 +1352,12 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt) goto f_err; } + OPENSSL_free(extensions); return MSG_PROCESS_CONTINUE_READING; f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); ossl_statem_set_error(s); + OPENSSL_free(extensions); return MSG_PROCESS_ERROR; } @@ -3117,11 +3119,13 @@ static MSG_PROCESS_RETURN tls_process_encrypted_extensions(SSL *s, PACKET *pkt) rawexts, &al)) goto err; + OPENSSL_free(rawexts); return MSG_PROCESS_CONTINUE_READING; err: ssl3_send_alert(s, SSL3_AL_FATAL, al); ossl_statem_set_error(s); + OPENSSL_free(rawexts); return MSG_PROCESS_ERROR; } -- GitLab