From bb984797509bef43632de51facaede93ab482278 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 27 Sep 2019 12:51:33 +0100 Subject: [PATCH] [Minor] Allocate memory from cfg pool to avoid leak --- src/libserver/dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libserver/dns.c b/src/libserver/dns.c index bbc9c2b45..f6e533523 100644 --- a/src/libserver/dns.c +++ b/src/libserver/dns.c @@ -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; -- 2.39.5