]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: fixing small memory leak in error code path.
authorDavid Carlier <devnexen@gmail.com>
Thu, 21 Sep 2017 14:36:43 +0000 (14:36 +0000)
committerWilly Tarreau <w@1wt.eu>
Thu, 21 Sep 2017 15:44:31 +0000 (17:44 +0200)
since we do not log the sample fetch when it is invalid, we can
free the log data.

src/log.c

index 5c42f6b2a2c601193273d59fe0fa07459150449f..520263a718dc104c6939af6469e4a20d78ee351f 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -484,6 +484,8 @@ int add_sample_to_logformat_list(char *text, char *arg, int arg_len, struct prox
                node->options |= LOG_OPT_RES_CAP; /* fetch method is response-compatible */
 
        if (!(expr->fetch->val & cap)) {
+               free(node);
+               node = NULL;
                memprintf(err, "sample fetch <%s> may not be reliably used here because it needs '%s' which is not available here",
                          text, sample_src_names(expr->fetch->use));
                return 0;