[openib-general] [PATCH] osm: fix memory leak in vendor ibumad

Eitan Zahavi eitan at mellanox.co.il
Wed Aug 23 06:34:32 PDT 2006


Hi Hal

These are two trivial fixes for memory leaks in the 
ibumad vendor.

Thanks

Eitan

Signed-off-by:  Eitan Zahavi <eitan at mellanox.co.il>

Index: libvendor/osm_vendor_ibumad_sa.c
===================================================================
--- libvendor/osm_vendor_ibumad_sa.c	(revision 9087)
+++ libvendor/osm_vendor_ibumad_sa.c	(working copy)
@@ -180,6 +180,11 @@ __osmv_sa_mad_rcv_cb(
 
   /* free the copied query request if found */
   if (p_query_req_copy) free(p_query_req_copy);
+
+  /* put back the request madw */
+  if (p_req_madw)
+    osm_mad_pool_put(p_bind->p_mad_pool, p_req_madw);
+
   OSM_LOG_EXIT( p_bind->p_log );
 }
 
Index: libvendor/osm_vendor_ibumad.c
===================================================================
--- libvendor/osm_vendor_ibumad.c	(revision 9087)
+++ libvendor/osm_vendor_ibumad.c	(working copy)
@@ -617,6 +617,7 @@ osm_vendor_get_all_port_attr(
 					*p_lid = ca.ports[j]->base_lid; 
 					*p_linkstates = ca.ports[j]->state; 
 					*p_portnum = ca.ports[j]->portnum;
+					free(ca.ports[j]);
 				}
 				p_lid++;
 				p_linkstates++;





More information about the general mailing list