X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=3ba55603d329342e6a30fa86b6908531e3e36e73;hb=81a5fd5046c6a39f580a8fc1a3af837fd5f5aa5c;hp=3a5a3ab87d7bd0a8320e88e5de5c4d08947d6222;hpb=0beb06563c5681975fd4f743c547e15f4facb29f;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index 3a5a3ab8..3ba55603 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; @@ -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)