From bb1ddd3d9a0d01656b90693a214b911995a5fe8c Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 12 Dec 2014 11:03:00 +0000 Subject: [PATCH] Fixed memory leak if BUF_MEM_grow fails Reviewed-by: Tim Hudson Reviewed-by: Kurt Roeckx --- ssl/d1_srvr.c | 1 + ssl/s23_srvr.c | 1 + 2 files changed, 2 insertions(+) diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 084118375f..5f15467f80 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -251,6 +251,7 @@ int dtls1_accept(SSL *s) } if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret= -1; goto end; } diff --git a/ssl/s23_srvr.c b/ssl/s23_srvr.c index e656ac234c..9840d474d5 100644 --- a/ssl/s23_srvr.c +++ b/ssl/s23_srvr.c @@ -192,6 +192,7 @@ int ssl23_accept(SSL *s) } if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret= -1; goto end; } -- 2.34.1