From: Olivier Houchard Date: Wed, 25 Nov 2026 17:04:37 +0000 (+0100) Subject: BUG/MINOR: ssl/cli: fix ckch_conf leaks in "add ssl crt-list" X-Git-Tag: v3.5-dev14~13 X-Git-Url: https://git.kaiwu.me/http/%22../static/control.html?a=commitdiff_plain;h=2626140532a72d30777b8bdc580cee9831b59cab;p=haproxy.git BUG/MINOR: ssl/cli: fix ckch_conf leaks in "add ssl crt-list" On success, cli_parse_add_crtlist() leaks the strings of a ckch_conf in two cases: when the store takes the conf parsed from the line, its previous conf is overwritten without being freed, and when the store already has instances, the parsed conf is only compared to the one of the store and never freed. Let's free the conf which is not used by the store. This was introduced by commit 1bc6e990f ("MEDIUM: ssl/cli: handle crt-store keywords in crt-list over the CLI") in 3.0-dev12, so this should be backported to 3.0, after commit 29225103f ("BUG/MEDIUM: ssl/cli: restore the store conf on "add ssl crt-list" error"). --- diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c index a0399cb3e..3b4499f7d 100644 --- a/src/ssl_crtlist.c +++ b/src/ssl_crtlist.c @@ -1462,6 +1462,9 @@ static int cli_parse_add_crtlist(char **args, char *payload, struct appctx *appc ctx->crtlist = crtlist; ctx->entry = entry; + /* the store uses only one of them */ + ckch_conf_clean(adopted ? &old_cc : &cc); + /* unlock is done in the release handler */ return 0;