X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=5aceae4e59e45ee55e3400340660c51b4dc4f78f;hb=2d51f3eaee79b36f9ec51381075b1f486b7921b8;hp=937a237e06f7c5cba61eb6d0fc713919dc4c1ab9;hpb=3489284330462f4edc85a75445a5cc8014e29db0;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index 937a237e..5aceae4e 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -503,6 +503,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 +553,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 +563,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 +697,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)