Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please AddressSan: match new/delete and plug a memleak
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 7 Mar 2017 06:46:31 +0000 (07:46 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 7 Mar 2017 06:46:31 +0000 (07:46 +0100)
src/smpi/smpi_global.cpp
src/surf/plugins/host_energy.cpp

index 924e89b..6dffca8 100644 (file)
@@ -646,7 +646,7 @@ void smpi_global_destroy()
     MPI_COMM_WORLD->cleanup_attributes();
     if(smpi_coll_cleanup_callback!=nullptr)
       smpi_coll_cleanup_callback();
-    xbt_free(MPI_COMM_WORLD);
+    delete MPI_COMM_WORLD;
   }
 
   MPI_COMM_WORLD = MPI_COMM_NULL;
index 124d6f2..a84acc7 100644 (file)
@@ -331,6 +331,7 @@ static void onSimulationEnd()
   }
   XBT_INFO("Total energy consumption: %f Joules (used hosts: %f Joules; unused/idle hosts: %f)",
            total_energy, used_hosts_energy, total_energy - used_hosts_energy);
+  xbt_free(host_list);
 }
 
 /* **************************** Public interface *************************** */