projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d7bc9c
)
write_sensu: fix resource leaks on error
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Sat, 2 Apr 2016 13:53:15 +0000
(15:53 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Sat, 2 Apr 2016 14:06:40 +0000
(16:06 +0200)
Fixes CID #37998
src/write_sensu.c
patch
|
blob
|
history
diff --git
a/src/write_sensu.c
b/src/write_sensu.c
index
5e231a5
..
c427467
100644
(file)
--- a/
src/write_sensu.c
+++ b/
src/write_sensu.c
@@
-192,6
+192,7
@@
static char *build_json_str_list(const char *tag, struct str_list const *list) /
res = asprintf(&temp_str, "\"%s\": [\"%s\"", tag, list->strs[0]);
if (res == -1) {
ERROR("write_sensu plugin: Unable to alloc memory");
+ free(ret_str);
return NULL;
}
for (i=1; i<list->nb_strs; i++) {