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)
This commit is contained in:
Bernd Edlinger 2023-11-01 08:05:30 +01:00 committed by Hugo Landau
parent 9e973eb297
commit daf26c2d7a

View File

@ -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);
}
}