Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit d2016f9

Browse files
committed
mtl/ofi: Check allocated pointer.
(cherry-picked from open-mpi/ompi@59b6d04)
1 parent dd6f479 commit d2016f9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ompi/mca/mtl/ofi/mtl_ofi.c

+9
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
110110
*/
111111
for (i = 0; i < nprocs; ++i) {
112112
endpoint = OBJ_NEW(mca_mtl_ofi_endpoint_t);
113+
if (NULL == endpoint) {
114+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
115+
"%s:%d: mtl/ofi: could not allocate endpoint"
116+
" structure\n",
117+
__FILE__, __LINE__);
118+
ret = OMPI_ERROR;
119+
goto bail;
120+
}
121+
113122
endpoint->mtl_ofi_module = &ompi_mtl_ofi;
114123
endpoint->peer_fiaddr = fi_addrs[i];
115124

0 commit comments

Comments
 (0)