]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allocate memory from cfg pool to avoid leak
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Sep 2019 11:51:33 +0000 (12:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Sep 2019 11:51:33 +0000 (12:51 +0100)
src/libserver/dns.c

index bbc9c2b4556f857125d4ab0a4db023fd955a568f..f6e533523ad99e7d4561e50b1e0bd4dcfc5816df 100644 (file)
@@ -270,7 +270,7 @@ rspamd_dns_server_init (struct upstream *up, guint idx, gpointer ud)
 
        g_assert (serv != NULL);
 
-       elt = g_malloc0 (sizeof (*elt));
+       elt = rspamd_mempool_alloc0 (r->cfg->cfg_pool, sizeof (*elt));
        elt->server = serv;
        elt->lib_data = up;