From 646b7741bc683d6c6b43342369afcbba33d7b6ec Mon Sep 17 00:00:00 2001 From: Nenad Merdanovic Date: Fri, 12 Apr 2019 22:54:28 +0200 Subject: [PATCH] BUG/MEDIUM: map: Fix memory leak in the map converter The allocated trash chunk is not freed properly and causes a memory leak exhibited as the growth in the trash pool allocations. Bug was introduced in commit 271022 (BUG/MINOR: map: fix map_regm with backref). This should be backported to all branches where the above commit was backported. --- src/map.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/map.c b/src/map.c index 903c5b267..cf1489307 100644 --- a/src/map.c +++ b/src/map.c @@ -207,6 +207,8 @@ static int sample_conv_map(const struct arg *arg_p, struct sample *smp, void *pr tmptrash->area, pat->data->u.str.area, (regmatch_t *)smp->ctx.a[0]); + free_trash_chunk(tmptrash); + if (len == -1) return 0;