daemon: malloc + memset -> calloc
[collectd.git] / src / daemon / types_list.c
index 3ac38f2..de6fce3 100644 (file)
@@ -112,12 +112,10 @@ static void parse_line (char *buf)
   if (fields[0][0] == '#')
     return;
 
-  ds = malloc (sizeof (*ds));
+  ds = calloc (1, sizeof (*ds));
   if (ds == NULL)
     return;
 
-  memset (ds, '\0', sizeof (data_set_t));
-
   sstrncpy (ds->type, fields[0], sizeof (ds->type));
 
   ds->ds_num = fields_num - 1;