plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit 286f68524e2f32afdbf43a3a9ed2cb5e0b647fd0
parent d7f59903e3c1fbb68ef934abcb5ac36f0dcdfbeb
Author: rsc <devnull@localhost>
Date:   Fri, 12 May 2006 20:52:12 +0000

avoid zombie when execvp fails

Diffstat:
Msrc/libthread/exec.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/libthread/exec.c b/src/libthread/exec.c @@ -93,6 +93,7 @@ _threadspawn(int fd[3], char *cmd, char *argv[]) n = read(p[0], exitstr, sizeof exitstr-1); close(p[0]); if(n > 0){ /* exec failed */ + free(waitfor(pid)); exitstr[n] = 0; errno = atoi(exitstr); return -1;