From: Aurelien DARRAGON Date: Tue, 4 Jul 2023 13:36:45 +0000 (+0200) Subject: BUG/MINOR: log: free errmsg on error in cfg_parse_log_forward() X-Git-Tag: v2.9-dev2~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f9d557468befde23be828df5f35f529079bebd0;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/log.c b/src/log.c index 93570b4dd7..7c626a9655 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; }