From 9c901db76cd719b621b6d102eb621db57076f956 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Mon, 27 Mar 2017 20:27:59 +0200 Subject: [PATCH] plug leaks --- examples/msg/platform-failures/platform-failures.c | 2 ++ examples/s4u/actor-create/s4u_actor-create.cpp | 2 ++ examples/smpi/replay_multiple/replay_multiple.c | 1 + 3 files changed, 5 insertions(+) diff --git a/examples/msg/platform-failures/platform-failures.c b/examples/msg/platform-failures/platform-failures.c index 1259ff442d..6875eb0de7 100644 --- a/examples/msg/platform-failures/platform-failures.c +++ b/examples/msg/platform-failures/platform-failures.c @@ -117,9 +117,11 @@ static int worker(int argc, char *argv[]) retcode = MSG_task_execute(task); if (retcode == MSG_OK) { XBT_INFO("\"%s\" done", MSG_task_get_name(task)); + free(task->data); MSG_task_destroy(task); } else if (retcode == MSG_HOST_FAILURE) { XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!"); + free(task->data); MSG_task_destroy(task); return 0; } else { diff --git a/examples/s4u/actor-create/s4u_actor-create.cpp b/examples/s4u/actor-create/s4u_actor-create.cpp index a20f02edea..b822e63286 100644 --- a/examples/s4u/actor-create/s4u_actor-create.cpp +++ b/examples/s4u/actor-create/s4u_actor-create.cpp @@ -77,6 +77,8 @@ public: char* msg1 = static_cast(simgrid::s4u::this_actor::recv(mailbox)); char* msg2 = static_cast(simgrid::s4u::this_actor::recv(mailbox)); XBT_INFO("I received '%s' and '%s'", msg1, msg2); + xbt_free(msg1); + xbt_free(msg2); XBT_INFO("I'm done. See you."); } }; diff --git a/examples/smpi/replay_multiple/replay_multiple.c b/examples/smpi/replay_multiple/replay_multiple.c index a2464b88be..4c064df958 100644 --- a/examples/smpi/replay_multiple/replay_multiple.c +++ b/examples/smpi/replay_multiple/replay_multiple.c @@ -48,6 +48,7 @@ int main(int argc, char *argv[]){ xbt_free(line_char); } + xbt_free(line); fclose(fp); -- 2.20.1