From fb42747f9a9ddf16e684d7cd5d8b60dd8cfca489 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 4 Dec 2015 21:50:55 +0100 Subject: [PATCH] types_list.c: fix two resource leaks CID #38017 --- src/daemon/types_list.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/daemon/types_list.c b/src/daemon/types_list.c index 75a980aa..cf28c2e1 100644 --- a/src/daemon/types_list.c +++ b/src/daemon/types_list.c @@ -122,14 +122,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; } -- 2.11.0