X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=80632424785ae697b8a809588cac5f1b2e61ba15;hb=6bf2e82bf5049af097beae4a8b7f086466520839;hp=937a237e06f7c5cba61eb6d0fc713919dc4c1ab9;hpb=38dc4293b77a5b26e9727fa5ab154fe8930a5a8c;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index 937a237e..80632424 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -28,7 +28,6 @@ #include "utils_avltree.h" #include "utils_complain.h" -#include #include #include @@ -503,6 +502,7 @@ static int cj_config_add_key (cj_t *db, /* {{{ */ { ERROR ("curl_json plugin: cj_config: " "Invalid key: %s", ci->key); + cj_key_free (key); return (-1); } @@ -552,7 +552,6 @@ static int cj_config_add_key (cj_t *db, /* {{{ */ db->tree = cj_avl_create(); tree = db->tree; - name = key->path; ptr = key->path; if (*ptr == '/') ++ptr; @@ -563,7 +562,7 @@ static int cj_config_add_key (cj_t *db, /* {{{ */ if (*ptr == '/') { c_avl_tree_t *value; - int len; + size_t len; len = ptr-name; if (len == 0) @@ -697,6 +696,7 @@ static int cj_config_add_url (oconfig_item_t *ci) /* {{{ */ { ERROR ("curl_json plugin: cj_config: " "Invalid key: %s", ci->key); + cj_free (db); return (-1); } if (status != 0)