X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Ftypes_list.c;h=de6fce3eed11e6251aed251041694484072e7e62;hb=e7ff69ca970e01edb1b15d79fc1b8dcfaa43e597;hp=cf28c2e149b838e9c6ecd0b126b498d23d4d8a2a;hpb=749b03b3fc459895b7415c7c13753066bf0af55b;p=collectd.git diff --git a/src/daemon/types_list.c b/src/daemon/types_list.c index cf28c2e1..de6fce3e 100644 --- a/src/daemon/types_list.c +++ b/src/daemon/types_list.c @@ -29,6 +29,7 @@ #include "plugin.h" #include "configfile.h" +#include "types_list.h" static int parse_ds (data_source_t *dsrc, char *buf, size_t buf_len) { @@ -111,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;