hurd: Fix exec() leak on proc_task2proc failure
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 15 Jan 2022 20:58:39 +0000 (21:58 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 15 Jan 2022 20:58:39 +0000 (21:58 +0100)
env is allocated after args, so should be freed before it.

hurd/hurdexec.c

index 546cc69..d5a20cb 100644 (file)
@@ -469,10 +469,10 @@ retry:
     /* Got a signal while inside an RPC of the critical section, retry again */
     goto retry;
 
- outargs:
-  free (args);
  outenv:
   free (env);
+ outargs:
+  free (args);
   return err;
 }
 libc_hidden_def (_hurd_exec_paths)