X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fwrite_sensu.c;h=2336541b63594f33d750ecd3203b8b0e6024f8d4;hb=70ea9457f76d6cd953f2cbd64eeda0ff265f47db;hp=791acb307c54612f3e78de98f322f7c48e6b0458;hpb=71478cd6550a4e930a1e9b8a906a66579e4e387a;p=collectd.git diff --git a/src/write_sensu.c b/src/write_sensu.c index 791acb30..2336541b 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -29,7 +29,6 @@ #include "common.h" #include "configfile.h" #include "utils_cache.h" -#include #include #include #include @@ -680,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 @@ -781,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);