]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Fix memory leak in curl plugin
authorBarbara Kaczorowska <bkjg@google.com>
Fri, 28 Aug 2020 10:20:26 +0000 (10:20 +0000)
committerFlorian Forster <octo@collectd.org>
Sun, 30 Aug 2020 06:30:32 +0000 (08:30 +0200)
This commit will add the patch that fixes the memory leak in curl
plugin. Before when AddressFamily field was set in config file in
variable af was pointer to value of this field and it wasn't freed at
the end. Now this bug is fixed.

src/curl.c

index 7eb480584ebfb7132a58b38005541aa917309110..3e9368545521140894b0087f2caa88c7eb36f7f7 100644 (file)
@@ -467,6 +467,7 @@ static int cc_config_add_page(oconfig_item_t *ci) /* {{{ */
                 child->key, page->instance);
         status = -1;
       }
+      free(af);
     } else if (strcasecmp("User", child->key) == 0)
       status = cf_util_get_string(child, &page->user);
     else if (strcasecmp("Password", child->key) == 0)