X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fwrite_sensu.c;h=2336541b63594f33d750ecd3203b8b0e6024f8d4;hb=70ea9457f76d6cd953f2cbd64eeda0ff265f47db;hp=67c04969227302c4f7f81dc0bafa2016587bd32a;hpb=9b39918bdadabb12ec040f0f191c0d21cb6ddd53;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);