X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmatch_empty_counter.c;h=eba6a58ea272445b98987dc3ca0c6d3cbc3beece;hb=2ce1db8202b1eba6da45b347c0c81a508f8c088a;hp=e30ff91bc7f17e6a9983a9215e53497ea8c78794;hpb=ca4a6c8a856a9012270ec10389b08d54e70e3401;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) {