From: Ruben Kerkhof Date: Fri, 1 Apr 2016 15:22:16 +0000 (+0200) Subject: netlink plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~28 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e3db77df14522b3781fe7e038ccca2cf3a5a73a6;p=collectd.git netlink plugin: malloc + memset -> calloc --- diff --git a/src/netlink.c b/src/netlink.c index c5f66f83..c8905d5c 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -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);