--- sysvinit-2.88dsf/src/init.c.wiget 2011-12-03 23:39:16.988206898 +0100 +++ sysvinit-2.88dsf/src/init.c 2011-12-03 23:47:53.761427001 +0100 @@ -911,6 +911,9 @@ void init_freeenv(char **e) { int n; + if (!e) + return; + for (n = 0; e[n]; n++) free(e[n]); free(e); @@ -1976,7 +1979,7 @@ void re_exec(void) CHILD *ch; sigset_t mask, oldset; pid_t pid; - char **env; + char **env = 0; int fd; if (strchr("S0123456",runlevel) == NULL) @@ -2027,8 +2030,13 @@ void re_exec(void) /* * The existing init process execs a new init binary. */ - env = init_buildenv(0); - execle(myname, myname, "--init", NULL, env); + if (pid > 0) { + /* + * The existing init process execs a new init binary. + */ + env = init_buildenv(0); + execle(myname, myname, "--init", NULL, env); + } /* * We shouldn't be here, something failed.