From 47f2683d0200167b4b268c53e34775188cff5366 Mon Sep 17 00:00:00 2001 From: Miguel Figueiredo Date: Sat, 1 Jun 2013 20:34:08 +0200 Subject: Fix invalid memory access * init/init.c (start_child): Don't free `arg' before it is used. --- init/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'init') diff --git a/init/init.c b/init/init.c index edfe1236..930408e8 100644 --- a/init/init.c +++ b/init/init.c @@ -1068,14 +1068,13 @@ start_child (const char *prog, char **progargs) NULL, 0, NULL, 0); mach_port_deallocate (mach_task_self (), default_ports[INIT_PORT_PROC]); mach_port_deallocate (mach_task_self (), file); - free (args); if (err) { error (0, err, "Cannot execute %s", args); free (args); return -1; } - + free (args); return 0; } -- cgit v1.2.3