diff mbox

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

Message ID 1472057792-30176-1-git-send-email-rmoats@us.ibm.com
State Accepted
Headers show

Commit Message

Ryan Moats Aug. 24, 2016, 4:56 p.m. UTC
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@us.ibm.com>
---
 ovn/controller/lflow.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ben Pfaff Aug. 26, 2016, 5:15 p.m. UTC | #1
On Wed, Aug 24, 2016 at 04:56:32PM +0000, Ryan Moats wrote:
> 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@us.ibm.com>

Applied to master and branch-2.6, thanks!
diff mbox

Patch

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. */