src/Makefile: Don't unnecessarily set plugin specific CXXFLAGS.
[collectd.git] / src / dns.c
index 3421c47..53fa725 100644 (file)
--- 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;