From 5b5e6a4c7525576ffe44aa9b7e67b3fd49ea2501 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 18 Dec 2012 13:17:00 -0800 Subject: [PATCH] ofproto-dpif: Fix memory leak in type_run(). The dpif_port_destroy() call was in the dpif_port_query_by_name() error path, when there's nothing to destroy, rather than in the "success" path, where there is data to destroy. Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 95fd54ee3..b78d6cf55 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -850,12 +850,12 @@ type_run(const char *type) sset_add(&ofproto->port_poll_set, devname); ofproto->port_poll_errno = 0; } - dpif_port_destroy(&port); } else if (!ofproto) { /* The port was added, but we don't know with which * ofproto we should associate it. Delete it. */ dpif_port_del(backer->dpif, port.port_no); } + dpif_port_destroy(&port); free(devname); } -- 2.43.0