X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Ftypes_list.c;fp=src%2Fdaemon%2Ftypes_list.c;h=de6fce3eed11e6251aed251041694484072e7e62;hb=91103db5378a036c0e4da9d512f686d9d0096ff7;hp=3ac38f23738911f8c22e885c8b94fc346e272b1b;hpb=04d03d38dc1e53b30541bbec1a8bdd769c0c6e04;p=collectd.git diff --git a/src/daemon/types_list.c b/src/daemon/types_list.c index 3ac38f23..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 = 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;