[hurd,commited] hurd: Fix exec() leak on proc_task2proc failure

Message ID 20220115205940.516933-1-samuel.thibault@ens-lyon.org
State Committed, archived
Headers
Series [hurd,commited] hurd: Fix exec() leak on proc_task2proc failure |

Checks

Context Check Description
dj/TryBot-apply_patch fail Patch failed to apply to master at the time it was sent
dj/TryBot-32bit fail Patch series failed to apply

Commit Message

Samuel Thibault Jan. 15, 2022, 8:59 p.m. UTC
  env is allocated after args, so should be freed before it.
---
 hurd/hurdexec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/hurd/hurdexec.c b/hurd/hurdexec.c
index 546cc69960..d5a20cb9b0 100644
--- a/hurd/hurdexec.c
+++ b/hurd/hurdexec.c
@@ -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)