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.
(cherry picked from commit 9f9d557468befde23be828df5f35f529079bebd0)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 791433ef72cc54814d09e189481be6cd4c553578)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit c18a9f7f129a942a790426644e1ec2c0ef8551ce)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit dfb578989f3e2778f7541d770a2dda554b6802cb)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/log.c b/src/log.c
index 206e9fd..c112a49 100644
--- a/src/log.c
+++ b/src/log.c
@@ -4173,6 +4173,7 @@
goto out;
}
out:
+ ha_free(&errmsg);
return err_code;
}