X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdns.c;h=2c3a90436da56e17196bcdde7ed245ac575d03a9;hb=5f8ea314e1852736d1e4b1e28b0b5288aad6f41a;hp=3421c475d7e6fc49c2419332dbcd8e5d3dd09f06;hpb=0657d95eaa686d64efe6bbccda346ebd6467bd0b;p=collectd.git diff --git a/src/dns.c b/src/dns.c index 3421c475..2c3a9043 100644 --- a/src/dns.c +++ b/src/dns.c @@ -30,7 +30,6 @@ #include "configfile.h" #include "utils_dns.h" -#include #include #include @@ -94,11 +93,10 @@ static counter_list_t *counter_list_create (counter_list_t **list, { counter_list_t *entry; - entry = (counter_list_t *) malloc (sizeof (counter_list_t)); + entry = calloc (1, sizeof (*entry)); if (entry == NULL) return (NULL); - memset (entry, 0, sizeof (counter_list_t)); entry->key = key; entry->value = value;