X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fwrite_sensu.c;h=2336541b63594f33d750ecd3203b8b0e6024f8d4;hb=40aabf444e124f40603021821e98bcc40c4aaa0e;hp=67c04969227302c4f7f81dc0bafa2016587bd32a;hpb=8dfaf98cde62e42d4c245400c68ae9c825a2fe68;p=collectd.git diff --git a/src/write_sensu.c b/src/write_sensu.c index 67c04969..2336541b 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -679,6 +679,7 @@ static char *sensu_notification_to_json(struct sensu_host *host, /* {{{ */ char *handlers_str = build_json_str_list("handlers", &(host->notification_handlers)); if (handlers_str == NULL) { ERROR("write_sensu plugin: Unable to alloc memory"); + free(ret_str); return NULL; } // incorporate the handlers @@ -780,6 +781,7 @@ static char *sensu_notification_to_json(struct sensu_host *host, /* {{{ */ char *msg = replace_json_reserved(n->message); if (msg == NULL) { ERROR("write_sensu plugin: Unable to alloc memory"); + free(ret_str); return NULL; } res = asprintf(&temp_str, "%s, \"output\": \"%s - %s\"", ret_str, severity, msg);