X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmatch_empty_counter.c;h=8f99a6d163cc0c4547fa516d30816e8d50181bc7;hb=72a76347831a848e6722d9147297a1e03c4c01d8;hp=e30ff91bc7f17e6a9983a9215e53497ea8c78794;hpb=ccc4feb9576f520596508418f404beb000fde1aa;p=collectd.git diff --git a/src/match_empty_counter.c b/src/match_empty_counter.c index e30ff91b..8f99a6d1 100644 --- a/src/match_empty_counter.c +++ b/src/match_empty_counter.c @@ -46,13 +46,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) {