From: David Carlier Date: Thu, 21 Sep 2017 14:36:43 +0000 (+0000) Subject: BUG/MINOR: log: fixing small memory leak in error code path. X-Git-Tag: v1.8-dev3~71 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=93e8b88f06122523c1dfdc3b81f33f78e1fa8d90;p=thirdparty%2Fhaproxy.git BUG/MINOR: log: fixing small memory leak in error code path. since we do not log the sample fetch when it is invalid, we can free the log data. --- diff --git a/src/log.c b/src/log.c index 5c42f6b2a2..520263a718 100644 --- 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;