diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-31 11:37:27 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-31 11:37:27 +0000 |
commit | 71ede76c68104c43a9f6980564fb6283a7f19473 (patch) | |
tree | 06c391e5791d700d76b59c5dd3aa2a187c5a66c6 /server.c | |
parent | 2e5b3ab8bc0e0f7a36f7a901263fa720654d60ca (diff) | |
download | rtmux-71ede76c68104c43a9f6980564fb6283a7f19473.tar.gz rtmux-71ede76c68104c43a9f6980564fb6283a7f19473.tar.bz2 rtmux-71ede76c68104c43a9f6980564fb6283a7f19473.zip |
Don't call tty_free unless the client is a terminal, otherwise tty_init hasn't
been called and it may end up doing close(0). From Kalle Olavi Niemitalo.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -915,7 +915,12 @@ server_lost_client(struct client *c) } log_debug("lost client %d", c->ibuf.fd); - tty_free(&c->tty); + /* + * If CLIENT_TERMINAL hasn't been set, then tty_init hasn't been called + * and tty_free might close an unrelated fd. + */ + if (c->flags & CLIENT_TERMINAL) + tty_free(&c->tty); screen_free(&c->status); |