infiniband-diags/libibnetdisc/ibnetdisc_cache.c: Fix a couple of memory leaks
PATCH 1/1 infiniband-diags/libibnetdisc/ibnetdisc_cache.c: Fix a couple of memory leaks
---
libibnetdisc/src/ibnetdisc_cache.c +2 -0
@@ -326,6 +326,7 @@ static int _load_node(int fd, ibnd_fabric_cache_t * fabric_cache) node = (ibnd_node_t *)malloc (sizeof (ibnd_node_t));if (!node) {IBND_DEBUG ("OOM: node\n" ); +free (node_cache);return -1 ; }memset (node,'\0' ,sizeof (ibnd_node_t));
@@ -426,6 +427,7 @@ static int _load_port(int fd, ibnd_fabric_cache_t * fabric_cache) port = (ibnd_port_t *)malloc (sizeof (ibnd_port_t));if (!port) {IBND_DEBUG ("OOM: port\n" ); +free (port_cache);return -1 ; }memset (port,'\0' ,sizeof (ibnd_port_t));
--
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
A message that is not in the archive (sent off-list or not yet received): 4DEF6F66.9070507-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Ira Weiny
AppliedQuoted 2 lines · On Wed, 8 Jun 2011 05:47:34 -0700 Hal Rosenstock…
Thanks applied,
Ira
Quoted 21 lines
---
libibnetdisc/src/ibnetdisc_cache.c +2
-0@@ -326,6 +326,7 @@ static int _load_node(int fd, ibnd_fabric_cache_t * fabric_cache) node = (ibnd_node_t *)malloc (sizeof (ibnd_node_t));if (!node) {IBND_DEBUG ("OOM: node\n" ); +free (node_cache);return -1 ; }memset (node,'\0' ,sizeof (ibnd_node_t));@@ -426,6 +427,7 @@ static int _load_port(int fd, ibnd_fabric_cache_t * fabric_cache) port = (ibnd_port_t *)malloc (sizeof (ibnd_port_t));if (!port) {IBND_DEBUG ("OOM: port\n" ); +free (port_cache);return -1 ; }memset (port,'\0' ,sizeof (ibnd_port_t));
Signature · 9 lines
Ira Weiny Math Programmer/Computer Scientist Lawrence Livermore National Lab 925-423-8008 [email protected] -- 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