diff --git a/ompi/mpi/c/comm_free.c b/ompi/mpi/c/comm_free.c index 94adb476f8..d948baec40 100644 --- a/ompi/mpi/c/comm_free.c +++ b/ompi/mpi/c/comm_free.c @@ -41,9 +41,12 @@ int MPI_Comm_free(MPI_Comm *comm) OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if ( NULL == *comm || MPI_COMM_WORLD == *comm || - MPI_COMM_SELF == *comm || ompi_comm_invalid (*comm)) { + ompi_comm_invalid (*comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); + } else if (MPI_COMM_SELF == *comm) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, MPI_ERR_COMM, + FUNC_NAME); } }