From 5830cf3ccf17a9fd7caa634d028309661779a4e6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 11 May 2026 15:26:32 +0200 Subject: [PATCH] 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. --- src/cache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.47.3