Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug a bunch of memleaks in SD examples and testsuites
[simgrid.git] / teshsuite / simdag / basic5 / basic5.c
index 59e0bf6..485cdcb 100644 (file)
@@ -39,9 +39,11 @@ int main(int argc, char **argv)
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
   SD_task_dependency_add(NULL, NULL, taskInit, taskB);
 
-  SD_task_schedule(taskInit, 1, sg_host_list(), no_cost, no_cost, -1.0);
-  SD_task_schedule(taskA, 2, sg_host_list(), no_cost, amount, -1.0);
-  SD_task_schedule(taskB, 1, sg_host_list(), comput, no_cost, -1.0);
+  sg_host_t *hosts = sg_host_list();
+  SD_task_schedule(taskInit, 1, hosts, no_cost, no_cost, -1.0);
+  SD_task_schedule(taskA, 2, hosts, no_cost, amount, -1.0);
+  SD_task_schedule(taskB, 1, hosts, comput, no_cost, -1.0);
+  xbt_free(hosts);
 
   /* let's launch the simulation! */
   SD_simulate(-1.0);