From: Matt Caswell Date: Tue, 13 Sep 2022 17:01:18 +0000 (+0100) Subject: Fix a record layer mem leak X-Git-Tag: openssl-3.2.0-alpha1~2018 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ff519542387d32ab1c3a8b1f45a375e1712a383;p=thirdparty%2Fopenssl.git Fix a record layer mem leak Make sure we free the record layer before we free the connection BIOs Reviewed-by: Hugo Landau Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/19198) --- diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 35758df33bf..440d1569759 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1361,13 +1361,13 @@ void ossl_ssl_connection_free(SSL *ssl) /* Ignore return value */ ssl_free_wbio_buffer(s); + RECORD_LAYER_clear(&s->rlayer); + BIO_free_all(s->wbio); s->wbio = NULL; BIO_free_all(s->rbio); s->rbio = NULL; - RECORD_LAYER_clear(&s->rlayer); - BUF_MEM_free(s->init_buf); /* add extra stuff */