[ofa-general] [infiniband-diags] [PATCH] [1/4] libibnetdisc cleanup patches round 2

Al Chu chu11 at llnl.gov
Thu Jul 9 13:21:13 PDT 2009


Fix potential memleak in ibnd_discover_fabric error path.

Al

-- 
Albert Chu
chu11 at llnl.gov
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
-------------- next part --------------
>From 254f8dd150ef2b3751ef98671ecbffefdc7618e6 Mon Sep 17 00:00:00 2001
From: Albert Chu <chu11 at llnl.gov>
Date: Tue, 7 Jul 2009 16:08:16 -0700
Subject: [PATCH] Fix potential memleak in ibnd_discover_fabric error path.

Signed-off-by: Albert Chu <chu11 at llnl.gov>
Signed-off-by: Ira Weiny <weiny2 at llnl.gov>
---
 infiniband-diags/libibnetdisc/src/ibnetdisc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c
index ffd8602..ea121dc 100644
--- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c
+++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c
@@ -602,7 +602,7 @@ ibnd_discover_fabric(struct ibmad_port *ibmad_port, int timeout_ms,
 
 	return ((ibnd_fabric_t *)fabric);
 error:
-	free(fabric);
+	ibnd_destroy_fabric(fabric);
 	return (NULL);
 }
 
-- 
1.5.4.5



More information about the general mailing list