X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=5aceae4e59e45ee55e3400340660c51b4dc4f78f;hb=20d15cfd26b23508242abcead906207bf26175d0;hp=c14e0f82969abb60652dace2c30f4abd484ca6ef;hpb=1b15b227585497f72ab0e42d96d79c0313323bd4;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index c14e0f82..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); } @@ -562,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) @@ -696,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)