diff options
author | Russ Cox <rsc@swtch.com> | 2008-05-05 23:09:48 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-05-05 23:09:48 -0400 |
commit | 454ae2ad280b9f41641ad2431604a04128d4db84 (patch) | |
tree | e388f8a5c28ea73a74b122cbb50a4051ce494259 /src | |
parent | 80f2165d274da5185a09ebda340505b067b08eb4 (diff) | |
download | plan9port-454ae2ad280b9f41641ad2431604a04128d4db84.tar.gz plan9port-454ae2ad280b9f41641ad2431604a04128d4db84.tar.bz2 plan9port-454ae2ad280b9f41641ad2431604a04128d4db84.zip |
libmux: more robust code
Diffstat (limited to 'src')
-rw-r--r-- | src/libmux/io.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libmux/io.c b/src/libmux/io.c index d9d9d8a6..3a2a9331 100644 --- a/src/libmux/io.c +++ b/src/libmux/io.c @@ -34,8 +34,11 @@ _muxrecvproc(void *v) qunlock(&mux->inlk); qlock(&mux->lk); _muxqhangup(q); - while(_muxnbqrecv(q, &p)) + p = nil; + while(_muxnbqrecv(q, &p) && p != nil){ free(p); + p = nil; + } free(q); mux->readq = nil; rwakeup(&mux->rpcfork); |