diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-15 14:52:26 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-15 14:52:26 +0100 |
commit | b6da76dfd1ace7e2959b995ef1932512e18ef7a0 (patch) | |
tree | 0ac36b15a56d46049d26d0e1c0ffeab3113686fc /src/libutil/map.c | |
parent | c08f35e976223b58cf76e8cfe2dac8f457e32fee (diff) | |
download | rspamd-b6da76dfd1ace7e2959b995ef1932512e18ef7a0.tar.gz rspamd-b6da76dfd1ace7e2959b995ef1932512e18ef7a0.zip |
[Minor] Fix memory leak in maps init logic
Diffstat (limited to 'src/libutil/map.c')
-rw-r--r-- | src/libutil/map.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; } |