Code

inteface plugin: add formatting string
[collectd.git] / src / dns.c
index f48be00968d856236a95282f5d7f56a192213290..2c3a90436da56e17196bcdde7ed245ac575d03a9 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -30,7 +30,6 @@
 #include "configfile.h"
 
 #include "utils_dns.h"
-#include <pthread.h>
 #include <poll.h>
 
 #include <pcap.h>
@@ -94,11 +93,10 @@ static counter_list_t *counter_list_create (counter_list_t **list,
 {
        counter_list_t *entry;
 
-       entry = malloc (sizeof (*entry));
+       entry = calloc (1, sizeof (*entry));
        if (entry == NULL)
                return (NULL);
 
-       memset (entry, 0, sizeof (counter_list_t));
        entry->key = key;
        entry->value = value;