From: Willy Tarreau Date: Mon, 11 May 2026 13:26:32 +0000 (+0200) Subject: BUG/MINOR: cache: fix memory leak in parse_cache_rule error path X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=5830cf3ccf17a9fd7caa634d028309661779a4e6;p=haproxy.git BUG/MINOR: cache: fix memory leak in parse_cache_rule error path When the filter config (fconf) allocation fails in parse_cache_rule, the previously allocated cache_flt_conf (cconf) and its strdup'd name string are not freed. The error path only freed cconf but not cconf->c.name, causing a memory leak. No backport is needed. --- diff --git a/src/cache.c b/src/cache.c index 9bed02004..4f4870524 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1950,7 +1950,10 @@ static int parse_cache_rule(struct proxy *proxy, const char *name, struct act_ru return 1; err: - free(cconf); + if (cconf) { + free(cconf->c.name); + free(cconf); + } return 0; }