diff --git a/ompi/mca/mtl/mxm/mtl_mxm.c b/ompi/mca/mtl/mxm/mtl_mxm.c index 4c1ca49f36..5bc03986a1 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm.c +++ b/ompi/mca/mtl/mxm/mtl_mxm.c @@ -267,9 +267,6 @@ static int ompi_mtl_mxm_recv_ep_address(ompi_proc_t *source_proc, void **address bail: free(modex_component_name); free(modex_name); - if (*address_p) { - free(*address_p); - } return rc; } @@ -310,14 +307,12 @@ int ompi_mtl_mxm_module_init(void) MXM_VERBOSE(1, "MXM support will be disabled because of total number " "of processes (%lu) is less than the minimum set by the " "mtl_mxm_np MCA parameter (%u)", totps, ompi_mtl_mxm.mxm_np); - free(procs); return OMPI_ERR_NOT_SUPPORTED; } MXM_VERBOSE(1, "MXM support enabled"); if (ORTE_NODE_RANK_INVALID == (lr = ompi_process_info.my_node_rank)) { MXM_ERROR("Unable to obtain local node rank"); - free(procs); return OMPI_ERROR; } nlps = ompi_process_info.num_local_peers + 1; @@ -327,7 +322,6 @@ int ompi_mtl_mxm_module_init(void) mxlr = max(mxlr, procs[proc]->super.proc_name.vpid); } } - free(procs); /* Setup the endpoint options and local addresses to bind to. */ #if MXM_API < MXM_VERSION(2,0) @@ -412,7 +406,7 @@ int ompi_mtl_mxm_add_procs(struct mca_mtl_base_module_t *mtl, size_t nprocs, mxm_conn_req_t *conn_reqs; size_t ep_index = 0; #endif - void *ep_address = NULL; + void *ep_address; size_t ep_address_len; mxm_error_t err; size_t i; @@ -508,16 +502,13 @@ bail: free(conn_reqs); free(ep_info); #endif - if (ep_address) { - free(ep_address); - } return rc; } int ompi_mtl_add_single_proc(struct mca_mtl_base_module_t *mtl, struct ompi_proc_t* procs) { - void *ep_address = NULL; + void *ep_address; size_t ep_address_len; mxm_error_t err; int rc; @@ -557,7 +548,6 @@ int ompi_mtl_add_single_proc(struct mca_mtl_base_module_t *mtl, "unknown" : procs->proc_hostname, mxm_error_string(conn_reqs.error)); } - free(ep_address); return OMPI_ERROR; } @@ -572,7 +562,6 @@ int ompi_mtl_add_single_proc(struct mca_mtl_base_module_t *mtl, err = mxm_ep_connect(ompi_mtl_mxm.ep, ep_address, &endpoint->mxm_conn); if (err != MXM_OK) { MXM_ERROR("MXM returned connect error: %s\n", mxm_error_string(err)); - free(ep_address); return OMPI_ERROR; } procs->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL] = endpoint;