Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug a tiny memleak
[simgrid.git] / src / smpi / smpi_base.c
index 96028af..380f9db 100644 (file)
@@ -20,14 +20,15 @@ void smpi_process_init(int* argc, char*** argv) {
 
   proc = SIMIX_process_self();
   index = atoi((*argv)[1]);
+  free((*argv)[1]);
   data = smpi_process_remote_data(index);
   SIMIX_process_set_data(proc, data);
-  DEBUG2("<%d> New process in the game: %p", index, proc);
   if (*argc > 2) {
     memmove(&(*argv)[1], &(*argv)[2], sizeof(char *) * (*argc - 2));
     (*argv)[(*argc) - 1] = NULL;
   }
   (*argc)--;
+  DEBUG2("<%d> New process in the game: %p", index, proc);
 }
 
 void smpi_process_destroy(void) {