X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Ftypes_list.c;h=436df6744445f96c616d22bca05b8d3ae2a638cd;hb=4103105fb43cd72294f165b2541540b3a8a99532;hp=eb50bb8a390969fcf580419b944e05b7fec537b8;hpb=a82395b57384541152423862bcf44c0db7789641;p=collectd.git diff --git a/src/daemon/types_list.c b/src/daemon/types_list.c index eb50bb8a..436df674 100644 --- a/src/daemon/types_list.c +++ b/src/daemon/types_list.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -112,12 +113,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;