>From 5c06cdf5029ca79a8c2e684a23b1b7e89a93c3a6 Mon Sep 17 00:00:00 2001
From: Dan Ben Yosef <da...@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 <da...@mellanox.com>
---
 opensm/osm_ucast_dfsssp.c | 1 +
 1 file changed, 1 insertion(+)

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;
                }
        }
-- 
1.7.11.3

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to