]> source.dussan.org Git - rspamd.git/commitdiff
Zero memory for inet address.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 30 Dec 2014 18:24:37 +0000 (18:24 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 30 Dec 2014 18:24:37 +0000 (18:24 +0000)
src/libutil/upstream.c

index d2c1d2ee0a23d16a77b4c80c0e2663547525eb48..bd7f84066b6cf93e394f6407fcedaa6a857f864a 100644 (file)
@@ -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));