From: Ben Pfaff Date: Wed, 25 Aug 2010 20:09:35 +0000 (-0700) Subject: ofproto: Fix memory leak in wx_port_free(). X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=40fad32064a98cdf795bb425812c96f63a79584c;p=sliver-openvswitch.git ofproto: Fix memory leak in wx_port_free(). 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 --- diff --git a/ofproto/wdp-xflow.c b/ofproto/wdp-xflow.c index 4a86d7ec6..32eace386 100644 --- a/ofproto/wdp-xflow.c +++ b/ofproto/wdp-xflow.c @@ -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