From 2709cad046fabc6b6d3ff198dd39d188040f991c Mon Sep 17 00:00:00 2001 From: Mark Kavanagh Date: Thu, 22 Feb 2018 11:55:44 +0000 Subject: [PATCH] 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 --- src/ovs_stats.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.11.0