From 286f68524e2f32afdbf43a3a9ed2cb5e0b647fd0 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 12 May 2006 20:52:12 +0000 Subject: avoid zombie when execvp fails --- src/libthread/exec.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libthread') diff --git a/src/libthread/exec.c b/src/libthread/exec.c index d7452488..a6d536ec 100644 --- 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; -- cgit v1.2.3