[ovs-dev] [PATCH ovn] ovn-controller.c: Fix memory leak of local_datapath->ports.

Han Zhou hzhou at ovn.org
Mon Oct 21 23:49:02 UTC 2019


Fixes: 89f5048f960c ("ovn-controller: Minimize SB DB port_binding lookups.")
Signed-off-by: Han Zhou <hzhou at ovn.org>
---
 controller/ovn-controller.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index b46a1d1..9ab98be 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -972,6 +972,7 @@ en_runtime_data_cleanup(struct engine_node *node)
     HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node,
                         &data->local_datapaths) {
         free(cur_node->peer_ports);
+        free(cur_node->ports);
         hmap_remove(&data->local_datapaths, &cur_node->hmap_node);
         free(cur_node);
     }
@@ -1002,6 +1003,7 @@ en_runtime_data_run(struct engine_node *node)
         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.1.0



More information about the dev mailing list