zookeeper plugin: remove dead code
[collectd.git] / src / write_sensu.c
index 268d9e4..507018f 100644 (file)
@@ -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);
@@ -1172,7 +1174,7 @@ static int sensu_config(oconfig_item_t *ci) /* {{{ */
                                continue;
                        }
                        if (child->values[0].type != OCONFIG_TYPE_STRING ||
-                           child->values[1].type != OCONFIG_TYPE_STRING) {
+                                       child->values[1].type != OCONFIG_TYPE_STRING) {
                                WARNING("sensu attribute needs string arguments.");
                                continue;
                        }
@@ -1180,7 +1182,9 @@ static int sensu_config(oconfig_item_t *ci) /* {{{ */
                        strarray_add(&sensu_attrs, &sensu_attrs_num, child->values[0].value.string);
                        strarray_add(&sensu_attrs, &sensu_attrs_num, child->values[1].value.string);
 
-                       DEBUG("write_sensu: got attr: %s => %s", key, val);
+                       DEBUG("write_sensu plugin: New attribute: %s => %s",
+                                       child->values[0].value.string,
+                                       child->values[1].value.string);
                } else if (strcasecmp(child->key, "tag") == 0) {
                        char *tmp = NULL;
                        status = cf_util_get_string(child, &tmp);