From 9f9d557468befde23be828df5f35f529079bebd0 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Tue, 4 Jul 2023 15:36:45 +0200 Subject: [PATCH] BUG/MINOR: log: free errmsg on error in cfg_parse_log_forward() When leaving cfg_parse_log_forward() on error paths, errmsg which is local to the function could still point to valid data, and it's our responsibility to free it. Instead of freeing it everywhere it is invoved, we free it prior to leaving the function. This should be backported as far as 2.4. --- src/log.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/log.c b/src/log.c index 93570b4dd..7c626a965 100644 --- a/src/log.c +++ b/src/log.c @@ -3962,6 +3962,7 @@ int cfg_parse_log_forward(const char *file, int linenum, char **args, int kwm) goto out; } out: + ha_free(&errmsg); return err_code; }