[ovs-dev] [PATCH] ovn-controller: Fix memory leak when parsing lflow actions.

Ryan Moats rmoats at us.ibm.com
Wed Aug 24 16:56:32 UTC 2016


Parsing logical flow actions with ovnacts_parse* that include
string constants current leak memory.  Add calls to ovnacts_free
to recapture said memory.

Signed-off-by: Ryan Moats <rmoats at us.ibm.com>
---
 ovn/controller/lflow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ovn/controller/lflow.c b/ovn/controller/lflow.c
index 341ca08..40aa49d 100644
--- a/ovn/controller/lflow.c
+++ b/ovn/controller/lflow.c
@@ -404,6 +404,7 @@ consider_logical_flow(const struct lport_index *lports,
         VLOG_WARN_RL(&rl, "error parsing actions \"%s\": %s",
                      lflow->actions, error);
         free(error);
+        ovnacts_free(ovnacts.data, ovnacts.size);
         ofpbuf_uninit(&ovnacts);
         return;
     }
@@ -428,6 +429,7 @@ consider_logical_flow(const struct lport_index *lports,
         .mac_bind_ptable = OFTABLE_MAC_BINDING,
     };
     ovnacts_encode(ovnacts.data, ovnacts.size, &ep, &ofpacts);
+    ovnacts_free(ovnacts.data, ovnacts.size);
     ofpbuf_uninit(&ovnacts);
 
     /* Translate OVN match into table of OpenFlow matches. */
-- 
2.7.4




More information about the dev mailing list