Skip to content

Commit d64ca14

Browse files
committed
coverity 1472872: check for NULL return from strdup
Signed-off-by: Aurelien Bouteiller <bouteill@icl.utk.edu>
1 parent a144e54 commit d64ca14

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ompi/dpm/dpm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,9 @@ int ompi_dpm_dyn_init(void)
16741674
ptr = &tmp[0];
16751675
}
16761676
port_name = strdup(ptr);
1677+
if (NULL == port_name) {
1678+
return OMPI_ERR_OUT_OF_RESOURCE;
1679+
}
16771680

16781681
rc = ompi_dpm_connect_accept(MPI_COMM_WORLD, root, port_name, send_first, &newcomm);
16791682
free(port_name);

0 commit comments

Comments
 (0)