X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdns.c;h=53fa725e00786ba6dede47e748a76336c4e86b91;hb=db35efb33e81d0a013e09a8a6ffa362ad5962f7c;hp=3421c475d7e6fc49c2419332dbcd8e5d3dd09f06;hpb=791e99923dbbf045b11fbd7b0ea8df647e29593e;p=collectd.git diff --git a/src/dns.c b/src/dns.c index 3421c475..53fa725e 100644 --- a/src/dns.c +++ b/src/dns.c @@ -94,11 +94,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;