From: Matt Caswell Date: Fri, 12 Dec 2014 11:03:00 +0000 (+0000) Subject: Fixed memory leak if BUF_MEM_grow fails X-Git-Tag: OpenSSL_1_0_1k~54 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7516eaf49216c3525506c9dedc008737c4a06501;p=oweals%2Fopenssl.git Fixed memory leak if BUF_MEM_grow fails Reviewed-by: Tim Hudson Reviewed-by: Kurt Roeckx (cherry picked from commit bb1ddd3d9a0d01656b90693a214b911995a5fe8c) --- diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 6a075b3396..a5660bc25b 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -233,6 +233,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 de909b1808..3178815ec9 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; }