X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmatch_empty_counter.c;h=eba6a58ea272445b98987dc3ca0c6d3cbc3beece;hb=667893e9be8a3a3f608d4b8550be9170732a0747;hp=e30ff91bc7f17e6a9983a9215e53497ea8c78794;hpb=b24fe01f603e1422de29c2cf090eabb043df1965;p=collectd.git diff --git a/src/match_empty_counter.c b/src/match_empty_counter.c index e30ff91b..eba6a58e 100644 --- a/src/match_empty_counter.c +++ b/src/match_empty_counter.c @@ -26,7 +26,6 @@ #include "collectd.h" #include "common.h" -#include "utils_cache.h" #include "filter_chain.h" /* @@ -46,13 +45,12 @@ static int mec_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ { mec_match_t *m; - m = (mec_match_t *) malloc (sizeof (*m)); + m = calloc (1, sizeof (*m)); if (m == NULL) { - ERROR ("mec_create: malloc failed."); + ERROR ("mec_create: calloc failed."); return (-ENOMEM); } - memset (m, 0, sizeof (*m)); if (ci->children_num != 0) {