X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=src%2Fdaemon%2Ftypes_list.c;h=eb50bb8a390969fcf580419b944e05b7fec537b8;hb=eb2f3a4bdc78e1e2c4191b4e08d75d5eeea8be0e;hp=75a980aa2a9801c2d754362beb1ca2e12642c820;hpb=71478cd6550a4e930a1e9b8a906a66579e4e387a;p=collectd.git diff --git a/src/daemon/types_list.c b/src/daemon/types_list.c index 75a980aa..eb50bb8a 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) { @@ -122,14 +123,18 @@ static void parse_line (char *buf) ds->ds_num = fields_num - 1; ds->ds = (data_source_t *) calloc (ds->ds_num, sizeof (data_source_t)); if (ds->ds == NULL) + { + sfree (ds); return; + } for (i = 0; i < ds->ds_num; i++) if (parse_ds (ds->ds + i, fields[i + 1], strlen (fields[i + 1])) != 0) { - sfree (ds->ds); ERROR ("types_list: parse_line: Cannot parse data source #%zu " "of data set %s", i, ds->type); + sfree (ds->ds); + sfree (ds); return; }