X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fwrite_sensu.c;h=507018fdd1f6a7688a0672679fdcd63628d58fe3;hb=791e99923dbbf045b11fbd7b0ea8df647e29593e;hp=f7803e86a24cf1194dd7ee2d1651b1a4d8628694;hpb=3bda998c6c40224c5949497fe4d19a9be2ff4a10;p=collectd.git diff --git a/src/write_sensu.c b/src/write_sensu.c index f7803e86..507018fd 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -680,6 +680,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 +782,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);