mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUG/MINOR: ssl_sock: Fix memory leak when disabling compression
according to manpage: sk_TYPE_zero() sets the number of elements in sk to zero. It does not free sk so after this call sk is still valid. so we need to free all elements [wt: seems like it has been there forever and should be backported to all stable branches]
This commit is contained in:
parent
4438c6061d
commit
e242f3dfb8
@ -9702,6 +9702,7 @@ __attribute__((constructor))
|
|||||||
static void __ssl_sock_init(void)
|
static void __ssl_sock_init(void)
|
||||||
{
|
{
|
||||||
STACK_OF(SSL_COMP)* cm;
|
STACK_OF(SSL_COMP)* cm;
|
||||||
|
int n;
|
||||||
|
|
||||||
if (global_ssl.listen_default_ciphers)
|
if (global_ssl.listen_default_ciphers)
|
||||||
global_ssl.listen_default_ciphers = strdup(global_ssl.listen_default_ciphers);
|
global_ssl.listen_default_ciphers = strdup(global_ssl.listen_default_ciphers);
|
||||||
@ -9719,7 +9720,11 @@ static void __ssl_sock_init(void)
|
|||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
#endif
|
#endif
|
||||||
cm = SSL_COMP_get_compression_methods();
|
cm = SSL_COMP_get_compression_methods();
|
||||||
sk_SSL_COMP_zero(cm);
|
n = sk_SSL_COMP_num(cm);
|
||||||
|
while (n--) {
|
||||||
|
(void) sk_SSL_COMP_pop(cm);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(USE_THREAD) && (HA_OPENSSL_VERSION_NUMBER < 0x10100000L)
|
#if defined(USE_THREAD) && (HA_OPENSSL_VERSION_NUMBER < 0x10100000L)
|
||||||
ssl_locking_init();
|
ssl_locking_init();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user