X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdns.c;h=2c3a90436da56e17196bcdde7ed245ac575d03a9;hb=5eb1fef6de7e0c8fb99e3d85063d96d7cc785f9b;hp=00fcff191e0ccf0177ec7bea309eb2964b331228;hpb=82e27678f8972d2625b466e7e7ba9daaa6395c98;p=collectd.git diff --git a/src/dns.c b/src/dns.c index 00fcff19..2c3a9043 100644 --- a/src/dns.c +++ b/src/dns.c @@ -21,6 +21,7 @@ * Mirko Buffoni **/ +#define _DEFAULT_SOURCE #define _BSD_SOURCE #include "collectd.h" @@ -29,11 +30,9 @@ #include "configfile.h" #include "utils_dns.h" -#include #include #include -#include /* * Private data types @@ -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;