BUG/MINOR: haproxy: fix rule->file memory leak
When using the "use_backend" configuration directive, the configuration
file name stored as rule->file was not freed in some situations. This
was introduced in commit 4ed1c95 ("MINOR: http/conf: store the
use_backend configuration file and line for logs").
This patch should be backported to 1.9, 1.8 and 1.7.
diff --git a/src/haproxy.c b/src/haproxy.c
index 4c5c839..ec66103 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -2223,8 +2223,8 @@
if (rule->cond) {
prune_acl_cond(rule->cond);
free(rule->cond);
- free(rule->file);
}
+ free(rule->file);
free(rule);
}