From: Ruben Kerkhof Date: Sat, 2 Apr 2016 13:53:15 +0000 (+0200) Subject: write_sensu: fix resource leaks on error X-Git-Tag: collectd-5.6.0~367 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0364c5a4059722fac659565af2d450ae6aace037;p=collectd.git write_sensu: fix resource leaks on error Fixes CID #37998 --- diff --git a/src/write_sensu.c b/src/write_sensu.c index 5e231a58..c427467c 100644 --- 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; inb_strs; i++) {