netlink plugin: malloc + memset -> calloc
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 15:22:16 +0000 (17:22 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 15:22:16 +0000 (17:22 +0200)
src/netlink.c

index c5f66f8..c8905d5 100644 (file)
@@ -109,12 +109,10 @@ static int add_ignorelist (const char *dev, const char *type,
 {
   ir_ignorelist_t *entry;
 
-  entry = malloc (sizeof (*entry));
+  entry = calloc (1, sizeof (*entry));
   if (entry == NULL)
     return (-1);
 
-  memset (entry, '\0', sizeof (ir_ignorelist_t));
-
   if (strcasecmp (dev, "All") != 0)
   {
     entry->device = strdup (dev);