Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug leaks
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 27 Mar 2017 18:27:59 +0000 (20:27 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 27 Mar 2017 18:27:59 +0000 (20:27 +0200)
examples/msg/platform-failures/platform-failures.c
examples/s4u/actor-create/s4u_actor-create.cpp
examples/smpi/replay_multiple/replay_multiple.c

index 1259ff4..6875eb0 100644 (file)
@@ -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 {
index a20f02e..b822e63 100644 (file)
@@ -77,6 +77,8 @@ public:
     char* msg1 = static_cast<char*>(simgrid::s4u::this_actor::recv(mailbox));
     char* msg2 = static_cast<char*>(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.");
   }
 };
index a2464b8..4c064df 100644 (file)
@@ -48,6 +48,7 @@ int main(int argc, char *argv[]){
 
     xbt_free(line_char);
   }
+  xbt_free(line);
 
   fclose(fp);