[ofa-general] [PATCH] osm: fixing memory leak in node description

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu Nov 15 05:22:29 PST 2007


Fix memory leak in node description

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_node_desc_rcv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/opensm/opensm/osm_node_desc_rcv.c b/opensm/opensm/osm_node_desc_rcv.c
index 2a2d3c8..e6a41a5 100644
--- a/opensm/opensm/osm_node_desc_rcv.c
+++ b/opensm/opensm/osm_node_desc_rcv.c
@@ -85,7 +85,7 @@ __osm_nd_rcv_process_nd(IN const osm_nd_rcv_t * const p_rcv,
 	/* make a copy for this node to "own" */
 	if (p_node->print_desc)
 		free(p_node->print_desc);
-	p_node->print_desc = strdup(tmp_desc);
+	p_node->print_desc = tmp_desc;

 	if (osm_log_is_active(p_rcv->p_log, OSM_LOG_VERBOSE)) {
 		osm_log(p_rcv->p_log, OSM_LOG_VERBOSE,
-- 
1.5.1.4




More information about the general mailing list