From 54a0d3535520d228f830d6d0397fa2b0b26293de Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 7 Mar 2017 07:46:31 +0100 Subject: [PATCH] please AddressSan: match new/delete and plug a memleak --- src/smpi/smpi_global.cpp | 2 +- src/surf/plugins/host_energy.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 924e89b011..6dffca85ab 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -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; diff --git a/src/surf/plugins/host_energy.cpp b/src/surf/plugins/host_energy.cpp index 124d6f21da..a84acc799b 100644 --- a/src/surf/plugins/host_energy.cpp +++ b/src/surf/plugins/host_energy.cpp @@ -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 *************************** */ -- 2.20.1