X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmatch_timediff.c;h=3b154150aac1aae6c06f491bc7ab3a32e89d808e;hb=5afde1077e3c8fc119b79caa2572cbf84dbfe5ca;hp=996201adfab746f28883865b05f6932572e756ce;hpb=21a4ddcc2d66eea59224fd95746c7533b1b1a46d;p=collectd.git diff --git a/src/match_timediff.c b/src/match_timediff.c index 996201ad..3b154150 100644 --- a/src/match_timediff.c +++ b/src/match_timediff.c @@ -26,7 +26,6 @@ #include "collectd.h" #include "common.h" -#include "utils_cache.h" #include "filter_chain.h" #define SATISFY_ALL 0 @@ -52,13 +51,12 @@ static int mt_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ int status; int i; - m = (mt_match_t *) malloc (sizeof (*m)); + m = calloc (1, sizeof (*m)); if (m == NULL) { - ERROR ("mt_create: malloc failed."); + ERROR ("mt_create: calloc failed."); return (-ENOMEM); } - memset (m, 0, sizeof (*m)); m->future = 0; m->past = 0; @@ -146,9 +144,8 @@ static int mt_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */ void module_register (void) { - match_proc_t mproc; + match_proc_t mproc = { 0 }; - memset (&mproc, 0, sizeof (mproc)); mproc.create = mt_create; mproc.destroy = mt_destroy; mproc.match = mt_match;