ofproto: Fix memory leak in wx_port_free().
authorBen Pfaff <blp@nicira.com>
Wed, 25 Aug 2010 20:09:35 +0000 (13:09 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 25 Aug 2010 20:09:35 +0000 (13:09 -0700)
wdp_port->devname should be freed, but this code wasn't doing that.  Fix
it by using the existing wdp_port_free() function, which does free the
devname.

Reported-by: Tsvi Slonim <tsvi@toroki.com>
ofproto/wdp-xflow.c

index 4a86d7e..32eace3 100644 (file)
@@ -2306,10 +2306,8 @@ wx_port_remove(struct wx *wx, struct wdp_port *wdp_port)
 static void
 wx_port_free(struct wdp_port *wdp_port)
 {
-    if (wdp_port) {
-        netdev_close(wdp_port->netdev);
-        free(wdp_port);
-    }
+    wdp_port_free(wdp_port);
+    free(wdp_port);
 }
 
 static void