aboutsummaryrefslogtreecommitdiff
path: root/src/libthread
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-05-12 20:52:12 +0000
committerrsc <devnull@localhost>2006-05-12 20:52:12 +0000
commit286f68524e2f32afdbf43a3a9ed2cb5e0b647fd0 (patch)
treed18067959dedd6419ddacc78dfd47fd93e0ffa5f /src/libthread
parentd7f59903e3c1fbb68ef934abcb5ac36f0dcdfbeb (diff)
downloadplan9port-286f68524e2f32afdbf43a3a9ed2cb5e0b647fd0.tar.gz
plan9port-286f68524e2f32afdbf43a3a9ed2cb5e0b647fd0.tar.bz2
plan9port-286f68524e2f32afdbf43a3a9ed2cb5e0b647fd0.zip
avoid zombie when execvp fails
Diffstat (limited to 'src/libthread')
-rw-r--r--src/libthread/exec.c1
1 files changed, 1 insertions, 0 deletions
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;