Strings may have been already strduped from config file parsing.

Signed-off-by: Albert L. Chu <[email protected]>
---
 opensm/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/opensm/main.c b/opensm/main.c
index f7a6d83..10cbef5 100644
--- a/opensm/main.c
+++ b/opensm/main.c
@@ -553,6 +553,8 @@ int osm_manager_loop(osm_subn_opt_t * p_opt, osm_opensm_t * 
p_osm)
 }
 
 #define SET_STR_OPT(opt, val) do { \
+       if (opt) \
+               free(opt); \
        opt = val ? strdup(val) : NULL ; \
 } while (0)
 
-- 
1.7.1



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

Reply via email to