Code

curl_json plugin: Fix memory leak.
authorFlorian Forster <octo@collectd.org>
Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)
committerFlorian Forster <octo@collectd.org>
Fri, 19 Jun 2015 08:54:02 +0000 (10:54 +0200)
src/curl_json.c

index ff07e76b54a631b693d345d4d0874b90122daa4b..6fdae51d2bf74b29ed4028ee2e77e5c66ca33954 100644 (file)
@@ -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);
   }
 
@@ -670,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)