]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: ssl: free ech_filedir in ssl_sock_free_ssl_conf()
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Dec 2026 10:08:08 +0000 (10:08 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Dec 2026 10:18:27 +0000 (11:18 +0100)
The "ech" parameter of a bind line stores the ECH keys directory in
ssl_bind_conf.ech_filedir, and the bind-level ssl_conf goes through
ssl_sock_free_ssl_conf() in ssl_sock_free_bind_conf(), but the
function never freed the field: the string was leaked at each proxy
stop and start, so on every reload of a configuration using
"bind ... ssl ech <dir>".

Free ech_filedir in ssl_sock_free_ssl_conf(), guarded by USE_ECH like
its assignment in bind_parse_ech().

This must be backported to 3.4, 3.3, 3.2 and 3.1.

Reported-by: Dominik Maier <dmnk@google.com>
src/ssl_crtlist.c

index 3b4499f7d122366b9a954d2d01eaf2a6fcb06353..b0885abf61dc2a2e19f95cf2e0341e2536a3a7f9 100644 (file)
@@ -78,6 +78,9 @@ void ssl_sock_free_ssl_conf(struct ssl_bind_conf *conf)
 #endif
 #if defined(SSL_CTX_set1_client_sigalgs_list)
                ha_free(&conf->client_sigalgs);
+#endif
+#ifdef USE_ECH
+       ha_free(&conf->ech_filedir);
 #endif
        }
 }