From: Denis Vlasenko Date: Wed, 18 Jul 2007 21:35:43 +0000 (-0000) Subject: ash: fix SEGV in forkchild (jp can be NULL). here documents were affected. X-Git-Tag: 1_7_0~122 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d4293c77f1b7f62f04ebb4fcd87063d73808bb12;p=oweals%2Fbusybox.git ash: fix SEGV in forkchild (jp can be NULL). here documents were affected. --- diff --git a/shell/ash.c b/shell/ash.c index 06c4698f9..32c440274 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -4424,7 +4424,8 @@ forkchild(struct job *jp, union node *n, int mode) #if JOBS /* For "jobs | cat" to work like in bash, we must retain list of jobs * in child, but we do need to remove ourself */ - freejob(jp); + if (jp) + freejob(jp); #else for (jp = curjob; jp; jp = jp->prev_job) freejob(jp);