diff mbox

osm_ucast_dfsssp.c: Fix memory leak in dfsssp_do_dijkstra_routing

Message ID 51A63A5E.1070900@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Hal Rosenstock May 29, 2013, 5:26 p.m. UTC
From 5c06cdf5029ca79a8c2e684a23b1b7e89a93c3a6 Mon Sep 17 00:00:00 2001
From: Dan Ben Yosef <danby@mellanox.com>
Date: Wed, 29 May 2013 15:41:41 +0300
Subject: [PATCH] osm_ucast_dfsssp.c: Fix memory leak in dfsssp_do_dijkstra_routing

Variable "sw_list" going out of scope leaks the storage it points to.

Signed-off-by: Dan Ben Yosef <danby@mellanox.com>
---
 opensm/osm_ucast_dfsssp.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/opensm/osm_ucast_dfsssp.c b/opensm/osm_ucast_dfsssp.c
index 95e1627..3972656 100644
--- a/opensm/osm_ucast_dfsssp.c
+++ b/opensm/osm_ucast_dfsssp.c
@@ -2181,6 +2181,7 @@  static int dfsssp_do_dijkstra_routing(void *context)
 		} else {
 			OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR,
 				"ERR AD31: corrupted sw_list array in dfsssp_do_dijkstra_routing\n");
+			free(sw_list);
 			return 1;
 		}
 	}