diff mbox

[ovs-dev,3/8] bridge: Fix memory leak in port_configure()

Message ID 1491601426-77274-3-git-send-email-yihung.wei@gmail.com
State Accepted
Headers show

Commit Message

Yi-Hung Wei April 7, 2017, 9:43 p.m. UTC
In testcase "ofproto-dpif - VLAN handling", valgrind reports a memory
leak with the following call stack.
    xcalloc (util.c:95)
    bitmap_allocate (bitmap.h:51)
    vlan_bitmap_from_array (vlan-bitmap.c:32)
    port_configure (bridge.c:983)
    bridge_reconfigure (bridge.c:682)
    bridge_run (bridge.c:2993)
    main (ovs-vswitchd.c:111)

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
---
 vswitchd/bridge.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ben Pfaff April 24, 2017, 4:27 p.m. UTC | #1
On Fri, Apr 07, 2017 at 02:43:41PM -0700, Yi-Hung Wei wrote:
> In testcase "ofproto-dpif - VLAN handling", valgrind reports a memory
> leak with the following call stack.
>     xcalloc (util.c:95)
>     bitmap_allocate (bitmap.h:51)
>     vlan_bitmap_from_array (vlan-bitmap.c:32)
>     port_configure (bridge.c:983)
>     bridge_reconfigure (bridge.c:682)
>     bridge_run (bridge.c:2993)
>     main (ovs-vswitchd.c:111)
> 
> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>

Thanks, I applied this to master.
diff mbox

Patch

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 867a26d8de19..fb3b27cd481e 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1052,6 +1052,7 @@  port_configure(struct port *port)
     ofproto_bundle_register(port->bridge->ofproto, port, &s);
 
     /* Clean up. */
+    free(s.cvlans);
     free(s.slaves);
     free(s.trunks);
     free(s.lacp_slaves);