]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix memory leak in maps init logic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jun 2018 13:52:26 +0000 (14:52 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jun 2018 13:52:26 +0000 (14:52 +0100)
src/libutil/map.c

index efbf85c45364a2b10a0de792467f14bc1bf37d5f..12e4f0a4e37442a2ace0e22d2faf6a8f5cb1dea1 100644 (file)
@@ -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;
 }