From 40fad32064a98cdf795bb425812c96f63a79584c Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 25 Aug 2010 13:09:35 -0700 Subject: [PATCH] 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 --- ofproto/wdp-xflow.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 -- 2.47.0