Skip to content

Commit b14212f

Browse files
committed
Fix Coverity issue 1338059.
1 parent 5c60e76 commit b14212f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/datatype/ompi_datatype_create_darray.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ int32_t ompi_datatype_create_darray(int size,
268268
displs[0] *= orig_extent;
269269

270270
*newtype = ompi_datatype_create(lastType->super.desc.used);
271-
ompi_datatype_add(*newtype, lastType, 1, displs[0], displs[1]);
271+
rc = ompi_datatype_add(*newtype, lastType, 1, displs[0], displs[1]);
272272
ompi_datatype_destroy(&lastType);
273273
/* need to destroy the old type even in error condition, so
274274
don't check return code from above until after cleanup. */
275-
if (MPI_SUCCESS != rc) goto cleanup;
275+
if (MPI_SUCCESS != rc) newtype = NULL;
276276
}
277277

278278
cleanup:

0 commit comments

Comments
 (0)