[ovs-dev] [PATCH 1/1] ovn-northd: fix memory leak in add_distributed_nat_routes() function

Damijan Skvarc damjan.skvarc at gmail.com
Wed Aug 7 11:28:17 UTC 2019


Within this function actions & match dynamic strings are used as helper
variables for adding entries into logical flow table. Variables are
used several times in order to optimize number of memory allocations,
however at the end memory was forgotten to be deallocated.

Signed-off-by: Damijan Skvarc <damjan.skvarc at gmail.com>
---
 northd/ovn-northd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 979dea4..8588961 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -5667,6 +5667,8 @@ add_distributed_nat_routes(struct hmap *lflows, const struct ovn_port *op)
             ds_clear(&actions);
         }
     }
+    ds_destroy(&match);
+    ds_destroy(&actions);
 }
 
 static void
-- 
2.7.4



More information about the dev mailing list