From 93eb67e63855e061dfbbffe2a691e45cd5269d87 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Wed, 1 May 2019 14:51:11 +0200 Subject: [PATCH] get out before dereferencing null pointer in this case --- src/smpi/mpi/smpi_comm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/smpi/mpi/smpi_comm.cpp b/src/smpi/mpi/smpi_comm.cpp index 6baa55961e..5bdf88d4f5 100644 --- a/src/smpi/mpi/smpi_comm.cpp +++ b/src/smpi/mpi/smpi_comm.cpp @@ -98,6 +98,8 @@ int Comm::dup(MPI_Comm* newcomm){ int Comm::dup_with_info(MPI_Info info, MPI_Comm* newcomm){ int ret = dup(newcomm); + if(ret != MPI_SUCCESS) + return ret; if((*newcomm)->info_!=MPI_INFO_NULL){ simgrid::smpi::Info::unref((*newcomm)->info_); (*newcomm)->info_=MPI_INFO_NULL; -- 2.20.1