Skip to content

Commit 90532de

Browse files
DUPRAT, JULIENEmmanuelBRELLE
authored andcommitted
[PML/UBCL] free endpoints when transport init failed
Signed-off-by: Brelle Emmanuel <[email protected]>
1 parent 959dc30 commit 90532de

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ompi/mca/pml/ubcl/pml_ubcl_endpoint.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int mca_pml_ubcl_create_endpoints(ompi_proc_t *proc)
352352
if (OMPI_SUCCESS == err) {
353353
goto end;
354354
} else if (OMPI_ERR_NOT_AVAILABLE != err) {
355-
return err;
355+
goto error;
356356
}
357357
}
358358

@@ -366,12 +366,12 @@ static int mca_pml_ubcl_create_endpoints(ompi_proc_t *proc)
366366
if (UBCL_ENDPOINT_TYPE_NONE == type) {
367367
mca_pml_ubcl_warn(err, "Failed to create recv endpoint for rank %zu\n",
368368
new_endpoint->rank);
369-
return err;
369+
goto error;
370370
}
371371
} else if (OMPI_SUCCESS != err) {
372372
mca_pml_ubcl_warn(err, "Failed to create recv endpoint for rank %zu\n",
373373
new_endpoint->rank);
374-
return err;
374+
goto error;
375375
}
376376
} while (OMPI_SUCCESS != err);
377377

@@ -381,7 +381,7 @@ static int mca_pml_ubcl_create_endpoints(ompi_proc_t *proc)
381381
if (OMPI_SUCCESS != err) {
382382
mca_pml_ubcl_warn(err, "Failed to create send endpoint for rank %zu\n",
383383
new_endpoint->rank);
384-
return err;
384+
goto error;
385385
}
386386

387387
end:
@@ -390,6 +390,10 @@ static int mca_pml_ubcl_create_endpoints(ompi_proc_t *proc)
390390
mca_pml_ubcl_endpoint_retain(proc);
391391

392392
return UBCL_SUCCESS;
393+
394+
error:
395+
free(new_endpoint);
396+
return err;
393397
}
394398

395399
int mca_pml_ubcl_add_procs(ompi_proc_t **procs, size_t nprocs)

0 commit comments

Comments
 (0)