X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdns.c;h=53fa725e00786ba6dede47e748a76336c4e86b91;hb=72a76347831a848e6722d9147297a1e03c4c01d8;hp=00fcff191e0ccf0177ec7bea309eb2964b331228;hpb=b61a03b05c1f4040a6599334b65141aa3bd134f5;p=collectd.git diff --git a/src/dns.c b/src/dns.c index 00fcff19..53fa725e 100644 --- a/src/dns.c +++ b/src/dns.c @@ -21,6 +21,7 @@ * Mirko Buffoni **/ +#define _DEFAULT_SOURCE #define _BSD_SOURCE #include "collectd.h" @@ -33,7 +34,6 @@ #include #include -#include /* * Private data types @@ -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;