]> git.proxmox.com Git - ovs.git/commitdiff
ovn-controller: Fix memory leak when parsing lflow actions.
authorRyan Moats <rmoats@us.ibm.com>
Wed, 24 Aug 2016 16:56:32 +0000 (16:56 +0000)
committerBen Pfaff <blp@ovn.org>
Fri, 26 Aug 2016 17:13:27 +0000 (10:13 -0700)
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>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ovn/controller/lflow.c

index 341ca087e89744ca19ed9c73e09575cf5019f775..40aa49d5439bf50a20da674e83710c689e8fd670 100644 (file)
@@ -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. */