From: Frederic Suter Date: Tue, 28 Mar 2017 15:26:33 +0000 (+0200) Subject: leak-- smell++ (C cast to avoid const_cast) X-Git-Tag: v3.16~423 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fd7325c13c2afc315d1dfa41c643a58197bfe99a leak-- smell++ (C cast to avoid const_cast) --- diff --git a/examples/simdag/test/sd_test.cpp b/examples/simdag/test/sd_test.cpp index 9b0f88679e..bef939ba5b 100644 --- a/examples/simdag/test/sd_test.cpp +++ b/examples/simdag/test/sd_test.cpp @@ -27,7 +27,7 @@ int main(int argc, char **argv) SD_create_environment(argv[1]); /* test the estimation functions */ - const sg_host_t *hosts = sg_host_list(); + const sg_host_t* hosts = sg_host_list(); simgrid::s4u::Host* h1 = hosts[4]; simgrid::s4u::Host* h2 = hosts[2]; double comp_amount1 = 2000000; @@ -141,5 +141,6 @@ int main(int argc, char **argv) XBT_DEBUG("Tasks destroyed. Exiting SimDag..."); SD_exit(); + xbt_free((sg_host_t*)hosts); return 0; }