CID #37999
Signed-off-by: Florian Forster <octo@collectd.org>
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
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);