[ofa-general] Re: [PATCH] [8 of 10] [REVISED] mesh analysis - reorder links

Sasha Khapyorsky sashak at voltaire.com
Sat Dec 20 12:18:28 PST 2008


On 12:44 Wed 10 Dec     , Robert Pearson wrote:
> 
> This patch implements
> 
>       - routine to reorder links and measure the size of the mesh

There are memory leaks - it allocates but doesn't free mesh->size and
node->coord. So I;m adding also the patch below.

Sasha

>From ec9daf997f22a4d63121a11a8dcde0ca1171b877 Mon Sep 17 00:00:00 2001
From: Sasha Khapyorsky <sashak at voltaire.com>
Date: Sat, 20 Dec 2008 21:26:58 +0200
Subject: [PATCH] opensm/mesh: fix memory leaks

Fix memory leaks.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/opensm/osm_mesh.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/opensm/opensm/osm_mesh.c b/opensm/opensm/osm_mesh.c
index 4deb004..a0b6e1d 100644
--- a/opensm/opensm/osm_mesh.c
+++ b/opensm/opensm/osm_mesh.c
@@ -1172,6 +1172,9 @@ static void mesh_delete(mesh_t *mesh)
 		if (mesh->class_count)
 			free(mesh->class_count);
 
+		if (mesh->size)
+			free(mesh->size);
+
 		free(mesh);
 	}
 }
@@ -1239,6 +1242,9 @@ void osm_mesh_node_delete(lash_t *p_lash, switch_t *sw)
 		if (node->axes)
 			free(node->axes);
 
+		if (node->coord)
+			free(node->coord);
+
 		free(node);
 
 		sw->node = NULL;
-- 
1.6.0.4.766.g6fc4a




More information about the general mailing list