opensm/osm_db_files.c: fix small memory leak
PATCH 1/1 opensm/osm_db_files.c: fix small memory leak
Signed-off-by Yevgeny Kliteynik <[email protected]>
--- opensm/opensm/osm_db_files.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
opensm/opensm/osm_db_files.c +1 -0
@@ -175,6 +175,7 @@ int osm_db_init(IN osm_db_t * p_db, IN osm_log_t * p_log)OSM_LOG (p_log,OSM_LOG_ERROR ,"ERR 6101: " "Failed to create the db directory:%s\n" , p_db_imp->db_dir_name); +free (p_db_imp);OSM_LOG_EXIT (p_log);return 1 ; }
Signature · 6 lines
1.6.2.4 -- 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
A message that is not in the archive (sent off-list or not yet received): 4C8654C0.7020208-VPRAkNaXOzVS1MOuV/[email protected]
Sasha Khapyorsky
AppliedQuoted 2 lines · Yevgeny Kliteynik
Signed-off-by Yevgeny Kliteynik <[email protected]>
Applied. Thanks.
Sasha
--
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
PATCH 1/1 opensm/osm_db_files.c: malloc() return value run-time check
In reply to a message not in the archiveCheck a return value of malloc() run-time instead of debug macro.
--- opensm/opensm/osm_db_files.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
opensm/opensm/osm_db_files.c +4 -1
@@ -157,7 +157,10 @@ int osm_db_init(IN osm_db_t * p_db, IN osm_log_t * p_log)OSM_LOG_ENTER (p_log); p_db_imp =malloc (sizeof (osm_db_imp_t)); -CL_ASSERT (p_db_imp !=NULL ); +if (!p_db_imp) { +OSM_LOG (p_log,OSM_LOG_ERROR ,"ERR 6100: No memory.\n" ); +return -1 ; + } p_db_imp->db_dir_name =getenv ("OSM_CACHE_DIR" );if (!p_db_imp->db_dir_name || !(*p_db_imp->db_dir_name))
Signature · 6 lines
1.7.0.4 -- 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