From 0364c5a4059722fac659565af2d450ae6aace037 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 2 Apr 2016 15:53:15 +0200 Subject: [PATCH] write_sensu: fix resource leaks on error Fixes CID #37998 --- src/write_sensu.c | 1 + 1 file changed, 1 insertion(+) 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++) { -- 2.30.2