diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2023-11-01 08:05:30 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-11-02 08:17:08 +0000 |
commit | daf26c2d7a4d29ec1040fc0d5d4215cfc2dcf4a7 (patch) | |
tree | a9400b5dc368e9b8d1573742b7aa34f97042c0a0 /ssl | |
parent | 9e973eb297c8127dcaefe97619ddcd5067d12f37 (diff) |
Fix a possible memory leak in load_builtin_compressions
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22585)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_ciph.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 35949f2dcc..8360991ce4 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); } } |