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