From bfed073bd6b2d4923286fe77b4813c330895bbfa Mon Sep 17 00:00:00 2001
From: Han Zhou <hzhou@ovn.org>
Date: Thu, 14 May 2020 22:27:39 +0530
Subject: [PATCH 3/4] ovn-controller.c: Fix memory leak of
local_datapath->ports.
Fixes: 89f5048f960c ("ovn-controller: Minimize SB DB port_binding lookups.")
Acked-by: Numan Siddique <numans@ovn.org>
Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Han Zhou <hzhou@ovn.org>
(cherry picked from upstream commit dc0e10c068c20c4e59c9c86ecee26baf8ed50e90)
Change-Id: I317fabe5ed0017893267524dc25881c20e764975
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
---
ovn/controller/ovn-controller.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index b80d6c0dc..8d7ea89c4 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -929,6 +929,7 @@ en_runtime_data_cleanup(void *data)
HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node,
&rt_data->local_datapaths) {
free(cur_node->peer_ports);
+ free(cur_node->ports);
hmap_remove(&rt_data->local_datapaths, &cur_node->hmap_node);
free(cur_node);
}
@@ -952,6 +953,7 @@ en_runtime_data_run(struct engine_node *node, void *data)
struct local_datapath *cur_node, *next_node;
HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node, local_datapaths) {
free(cur_node->peer_ports);
+ free(cur_node->ports);
hmap_remove(local_datapaths, &cur_node->hmap_node);
free(cur_node);
}
--
2.26.2