X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnetlink.c;h=c8905d5ca10325c1b4100d003b90015315b2ac02;hb=3c721721a66ef05042e2aa77e65f49a861bb0bb4;hp=aa9760f9328b78eb87e14f70501bc1622a57f12d;hpb=1fc00932fd49fa535551cc4bba09c4e4be059ab4;p=collectd.git diff --git a/src/netlink.c b/src/netlink.c index aa9760f9..c8905d5c 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -30,7 +30,6 @@ #include "common.h" #include -#include #include #include @@ -110,12 +109,10 @@ static int add_ignorelist (const char *dev, const char *type, { ir_ignorelist_t *entry; - entry = (ir_ignorelist_t *) malloc (sizeof (ir_ignorelist_t)); + 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); @@ -471,7 +468,7 @@ static int qos_filter_cb (const struct nlmsghdr *nlh, void *args) const char *kind = NULL; /* char *type_instance; */ - char *tc_type; + const char *tc_type; char tc_inst[DATA_MAX_NAME_LEN]; _Bool stats_submitted = 0;