X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmatch_empty_counter.c;h=8f99a6d163cc0c4547fa516d30816e8d50181bc7;hb=354f9991530248e45207d236eb74c1cc3d5238ef;hp=e30ff91bc7f17e6a9983a9215e53497ea8c78794;hpb=eb2f3a4bdc78e1e2c4191b4e08d75d5eeea8be0e;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) {