Skip to content

Commit c36452f

Browse files
committed
mtl/ofi: set initial value variables in ompi_mtl_ofi_component_init()
This patch set initial value of "ep_name" and "namelen" in function ompi_mtl_ofi_component_init(). This is because free() is applied to "ep_name" on error handling path, and uninitialized "ep_name" can cause trouble. Signed-off-by: Wei Zhang <wzam@amazon.com>
1 parent b2c26c5 commit c36452f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/mca/mtl/ofi/mtl_ofi_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,8 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
604604
struct fi_info *providers = NULL;
605605
struct fi_info *prov = NULL;
606606
struct fi_info *prov_cq_data = NULL;
607-
void *ep_name;
608-
size_t namelen;
607+
void *ep_name = NULL;
608+
size_t namelen = 0;
609609
int universe_size;
610610
char *univ_size_str;
611611

0 commit comments

Comments
 (0)