X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdaemon%2Ftypes_list.c;h=de6fce3eed11e6251aed251041694484072e7e62;hb=dc3637c5113c79e83d8d104c88c9cc5057dc9dcb;hp=eb50bb8a390969fcf580419b944e05b7fec537b8;hpb=6a1a62048b6d0d2ddf5c17295609d3ebf010f40b;p=collectd.git diff --git a/src/daemon/types_list.c b/src/daemon/types_list.c index eb50bb8a..de6fce3e 100644 --- a/src/daemon/types_list.c +++ b/src/daemon/types_list.c @@ -112,12 +112,10 @@ static void parse_line (char *buf) if (fields[0][0] == '#') return; - ds = (data_set_t *) malloc (sizeof (data_set_t)); + 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;