From: Bernd Edlinger Date: Wed, 1 Nov 2023 07:05:30 +0000 (+0100) Subject: Fix a possible memory leak in load_builtin_compressions X-Git-Tag: openssl-3.1.5~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4aa8176afafb339c6c2e3002d67b30f284fec6a;p=thirdparty%2Fopenssl.git Fix a possible memory leak in load_builtin_compressions Reviewed-by: Dmitry Belyavskiy Reviewed-by: Paul Dale Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/22585) (cherry picked from commit daf26c2d7a4d29ec1040fc0d5d4215cfc2dcf4a7) --- diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 93de9cf8fd4..e3c2b1c1962 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -465,7 +465,8 @@ DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions) comp->method = method; comp->id = SSL_COMP_ZLIB_IDX; comp->name = COMP_get_name(method); - sk_SSL_COMP_push(ssl_comp_methods, comp); + if (!sk_SSL_COMP_push(ssl_comp_methods, comp)) + OPENSSL_free(comp); sk_SSL_COMP_sort(ssl_comp_methods); } }