]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: free errmsg on error in cfg_parse_log_forward()
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 4 Jul 2023 13:36:45 +0000 (15:36 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 10 Jul 2023 16:28:08 +0000 (18:28 +0200)
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

index 93570b4dd7e167336819a309bb925937463a3792..7c626a9655f3e59a97b48e868ddce59b2e65ff44 100644 (file)
--- 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;
 }