]> AND Public Git Repository - simgrid.git/blobdiff - examples/msg/platform-failures/platform-failures.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #259 from simgrid/configfix
[simgrid.git] / examples / msg / platform-failures / platform-failures.c
index 1259ff442d4a38e3b82865cc8a810206bb236ea2..7771e50925c31eb732ec4348ed4811596cf436a9 100644 (file)
@@ -1,11 +1,12 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/msg.h"
 
+#include <stdio.h> /* snprintf */
+
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
 #define FINALIZE ((void*)221297)        /* a magic number to tell people to stop working */
@@ -117,9 +118,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 {