diff options
author | rsc <devnull@localhost> | 2006-05-12 20:52:12 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-05-12 20:52:12 +0000 |
commit | 286f68524e2f32afdbf43a3a9ed2cb5e0b647fd0 (patch) | |
tree | d18067959dedd6419ddacc78dfd47fd93e0ffa5f /src/libthread | |
parent | d7f59903e3c1fbb68ef934abcb5ac36f0dcdfbeb (diff) | |
download | plan9port-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.c | 1 |
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; |