dns plugin: malloc + memset -> calloc
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 13:49:57 +0000 (15:49 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 13:49:57 +0000 (15:49 +0200)
src/dns.c

index f48be00..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 = 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;