From: Mark Kavanagh Date: Thu, 22 Feb 2018 11:55:44 +0000 (+0000) Subject: ovs_stats: fix memory leak X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2709cad046fabc6b6d3ff198dd39d188040f991c;p=collectd.git ovs_stats: fix memory leak In ovs_stats_plugin_config(), memory may be allocated from the heap, but is not subsequently freed in the case of failure later in the function. Fixes: bcf9c48 ("ovs_stats plugin: Fix a memory leak.") Signed-off-by: Mark Kavanagh --- diff --git a/src/ovs_stats.c b/src/ovs_stats.c index 1e6ddd2d..f56e12b6 100644 --- a/src/ovs_stats.c +++ b/src/ovs_stats.c @@ -849,6 +849,7 @@ static int ovs_stats_plugin_config(oconfig_item_t *ci) { char *br_name_dup = strdup(br_name); if (br_name_dup == NULL) { ERROR("%s: strdup() copy bridge name fail", plugin_name); + sfree(bridge); goto cleanup_fail; }