Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
get out before dereferencing null pointer in this case
authorAugustin Degomme <adegomme@users.noreply.github.com>
Wed, 1 May 2019 12:51:11 +0000 (14:51 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Wed, 1 May 2019 12:51:11 +0000 (14:51 +0200)
src/smpi/mpi/smpi_comm.cpp

index 6baa559..5bdf88d 100644 (file)
@@ -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;