X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=6fdae51d2bf74b29ed4028ee2e77e5c66ca33954;hb=b78ed0cf5d6be5def5e3ea9287ffa1e785558d81;hp=6dec89e518d2515b33c6ba4afc7aafaadbf2506a;hpb=61bda3c7438f57086b0fcf87cc54407efcbaf9e3;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index 6dec89e5..6fdae51d 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -500,6 +500,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); } @@ -549,7 +550,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; @@ -671,6 +671,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)