projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8cea744
)
types_list.c: fix two resource leaks
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 4 Dec 2015 20:50:55 +0000
(21:50 +0100)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 4 Dec 2015 20:52:06 +0000
(21:52 +0100)
CID #38017
src/daemon/types_list.c
patch
|
blob
|
history
diff --git
a/src/daemon/types_list.c
b/src/daemon/types_list.c
index
75a980a
..
cf28c2e
100644
(file)
--- 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;
}