]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: haproxy: fix rule->file memory leak
authorDragan Dosen <ddosen@haproxy.com>
Mon, 29 Apr 2019 22:38:36 +0000 (00:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 May 2019 08:05:06 +0000 (10:05 +0200)
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.

src/haproxy.c

index 4c5c8391d215d4f8c92ebb5e60848bb791c0421e..ec6610325c572e18f3c6c52e78a24201a76e3ee0 100644 (file)
@@ -2223,8 +2223,8 @@ void deinit(void)
                        if (rule->cond) {
                                prune_acl_cond(rule->cond);
                                free(rule->cond);
-                               free(rule->file);
                        }
+                       free(rule->file);
                        free(rule);
                }