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: master-pre-reformat~107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=24097938ad19acaaac00f4e8549bfe1a976d662d;p=thirdparty%2Fopenssl.git Fixed memory leak if BUF_MEM_grow fails Reviewed-by: Tim Hudson Reviewed-by: Kurt Roeckx --- diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index aef38bb7542..0cdc51be23e 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 08aa5b6cf08..6e44e0cd64e 100644 --- a/ssl/s23_srvr.c +++ b/ssl/s23_srvr.c @@ -185,6 +185,7 @@ int ssl23_accept(SSL *s) } if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret= -1; goto end; }