match plugins: malloc + memset -> calloc
[collectd.git] / src / match_timediff.c
index 2b5f530..77c8f51 100644 (file)
@@ -52,13 +52,12 @@ static int mt_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
   int status;
   int i;
 
-  m = malloc (sizeof (*m));
+  m = calloc (1, sizeof (*m));
   if (m == NULL)
   {
-    ERROR ("mt_create: malloc failed.");
+    ERROR ("mt_create: calloc failed.");
     return (-ENOMEM);
   }
-  memset (m, 0, sizeof (*m));
 
   m->future = 0;
   m->past = 0;