[ovs-dev] [PATCH] netdev: Fix memory leak on error path.

William Tu u9012063 at gmail.com
Thu Oct 12 17:26:03 UTC 2017


Found by inspection.

Signed-off-by: William Tu <u9012063 at gmail.com>
---
 lib/netdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/netdev.c b/lib/netdev.c
index b4e570bafd08..bedc21dec48e 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -2220,6 +2220,8 @@ netdev_ports_insert(struct netdev *netdev, const struct dpif_class *dpif_class,
     ovs_mutex_lock(&netdev_hmap_mutex);
     if (netdev_ports_lookup(dpif_port->port_no, dpif_class)) {
         ovs_mutex_unlock(&netdev_hmap_mutex);
+        free(data);
+        free(ifidx);
         return EEXIST;
     }
 
-- 
2.7.4



More information about the dev mailing list