projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3fb6fe5
)
write_prometheus: plug a small leak
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 9 Dec 2016 14:41:18 +0000
(15:41 +0100)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 9 Dec 2016 14:41:18 +0000
(15:41 +0100)
Found by scan-build
src/write_prometheus.c
patch
|
blob
|
history
diff --git
a/src/write_prometheus.c
b/src/write_prometheus.c
index
991415e
..
6b77712
100644
(file)
--- a/
src/write_prometheus.c
+++ b/
src/write_prometheus.c
@@
-694,8
+694,10
@@
metric_family_get(data_set_t const *ds, value_list_t const *vl, size_t ds_index,
return fam;
}
- if (!allocate)
+ if (!allocate) {
+ sfree(name);
return NULL;
+ }
fam = metric_family_create(name, ds, vl, ds_index);
if (fam == NULL) {