Skip to contentSkip to conversation

opensm/osm_mcast_mgr.c: fix memory leak

PATCH New Sasha Khapyorsky 1 participant 1 message Feb 3, 2010 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opensm/osm_mcast_mgr.c: fix memory leak

Memory leak is possible in case of port list allocation failure. Fix this by proper cleanup.

---
 opensm/opensm/osm_mcast_mgr.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
opensm/opensm/osm_mcast_mgr.c +2 -0
index dce9f2b..d7267e4 100644
@@ -549,6 +549,8 @@ static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, uint16_t mlid_ho,
 		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A16: "
 			"Unable to allocate list array\n");
 		mcast_mgr_purge_list(sm, p_list);
+		osm_mtree_destroy(p_mtn);
+		p_mtn = NULL;
 		goto Exit;
 	}
 
Signature · 6 lines
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html