match plugins: malloc + memset -> calloc
[collectd.git] / src / match_empty_counter.c
index 4a5dc8c..8f99a6d 100644 (file)
@@ -46,13 +46,12 @@ static int mec_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
 {
   mec_match_t *m;
 
-  m = 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)
   {