From b6da76dfd1ace7e2959b995ef1932512e18ef7a0 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 15 Jun 2018 14:52:26 +0100 Subject: [PATCH] [Minor] Fix memory leak in maps init logic --- src/libutil/map.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libutil/map.c b/src/libutil/map.c index efbf85c45..12e4f0a4e 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -1841,6 +1841,8 @@ rspamd_map_backend_dtor (struct rspamd_map_backend *bk) if (bk->data.sd->data) { g_free (bk->data.sd->data); } + + g_free (bk->data.sd); } break; case MAP_PROTO_HTTP: @@ -2293,6 +2295,12 @@ rspamd_map_add_from_ucl (struct rspamd_config *cfg, err: + if (map) { + PTR_ARRAY_FOREACH (map->backends, i, bk) { + MAP_RELEASE (bk, "rspamd_map_backend"); + } + } + return NULL; } -- 2.39.5