From 927a3f3d04567098ce64b73cef90473a9a993618 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 30 Dec 2014 18:24:37 +0000 Subject: [PATCH] Zero memory for inet address. --- src/libutil/upstream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index d2c1d2ee0..bd7f84066 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -165,7 +165,7 @@ rspamd_upstream_dns_cb (struct rdns_reply *reply, void *arg) while (entry) { if (entry->type == RDNS_REQUEST_A) { - up_ent = g_malloc (sizeof (*up_ent)); + up_ent = g_malloc0 (sizeof (*up_ent)); up_ent->addr.addr.s4.sin_addr = entry->content.a.addr; up_ent->addr.af = AF_INET; @@ -174,7 +174,7 @@ rspamd_upstream_dns_cb (struct rdns_reply *reply, void *arg) LL_PREPEND (up->new_addrs, up_ent); } else if (entry->type == RDNS_REQUEST_AAAA) { - up_ent = g_malloc (sizeof (*up_ent)); + up_ent = g_malloc0 (sizeof (*up_ent)); memcpy (&up_ent->addr.addr.s6.sin6_addr, &entry->content.aaa.addr, sizeof (struct in6_addr)); -- 2.39.5