From 503ddb0c04cf79510d2a6921a26a30ef714e6634 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Fri, 9 May 2025 19:01:28 +0200 Subject: [PATCH] BUG/MINOR: ssl/ckch: always free() the previous entry during parsing The ckch_conf_parse() function is the generic function which parses crt-store keywords from the crt-store section, and also from a crt-list. When having multiple time the same keyword, a leak of the previous value happens. This patch ensure that the previous value is always freed before overwriting it. This patch should be backported as far as 3.0. (cherry picked from commit 311e0aa5c712f38700b7b185c0d5f1aa33c48613) Signed-off-by: Willy Tarreau (cherry picked from commit adebe6246558ece09c82fbbf3e549cf5e4cdd2ec) Signed-off-by: Christopher Faulet --- src/ssl_ckch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 3e8b7a2..5a6fc62 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -4305,6 +4305,7 @@ int ckch_conf_parse(char **args, int cur_arg, struct ckch_conf *f, int *found, c if (ckch_conf_kws[i].type == PARSE_TYPE_STR) { char **t = target; + ha_free(t); *t = strdup(args[cur_arg + 1]); if (!*t) { ha_alert("parsing [%s:%d]: out of memory.\n", file, linenum); -- 1.7.10.4