Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove memleaks
authorNavarrop <Pierre.Navarro@imag.fr>
Wed, 30 Nov 2011 15:58:46 +0000 (16:58 +0100)
committerNavarrop <Pierre.Navarro@imag.fr>
Wed, 30 Nov 2011 15:58:46 +0000 (16:58 +0100)
examples/msg/masterslave/masterslave_arg.c

index 7ad5d0b..a8dbf97 100644 (file)
@@ -123,12 +123,15 @@ int main(int argc, char *argv[])
 
   for(i = 0 ; i<number_of_slaves; i++)
   {
-      MSG_process_create(bprintf("slave-%ld",i),
+    char* name_host = bprintf("slave-%ld",i);
+      MSG_process_create( name_host,
                           slave,
                           NULL,
                           host_table[my_random(number_of_slaves)]
                           );
+      free(name_host);
   }
+  xbt_free(host_table);
 
   res = MSG_main();