From 454ae2ad280b9f41641ad2431604a04128d4db84 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 5 May 2008 23:09:48 -0400 Subject: libmux: more robust code --- src/libmux/io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libmux') 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); -- cgit v1.2.3