diff options
author | Max Kellermann <max@duempel.org> | 2008-09-06 15:31:55 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-06 15:31:55 +0200 |
commit | 6146d4f5bbb800a1499ab23ea8cc997e97d6cb06 (patch) | |
tree | 815b51c260a247c3732bdf29e543383656a99450 | |
parent | 77b1671662f1ae19c7f49bdbb64ebf570fbb1bec (diff) | |
download | mpd-6146d4f5bbb800a1499ab23ea8cc997e97d6cb06.tar.gz mpd-6146d4f5bbb800a1499ab23ea8cc997e97d6cb06.tar.xz mpd-6146d4f5bbb800a1499ab23ea8cc997e97d6cb06.zip |
client: don't check FD_ISSET(client->fd) on expired client
client->fd becomes -1 when the client expires. Don't use FD_ISSET()
with this expired client; doing so would cause a crash due to SIGBUS.
-rw-r--r-- | src/client.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c index 2acc15567..28fb52705 100644 --- a/src/client.c +++ b/src/client.c @@ -540,7 +540,8 @@ int client_manager_io(void) } client->lastTime = time(NULL); } - if (FD_ISSET(client->fd, &wfds)) { + if (!client_is_expired(client) && + FD_ISSET(client->fd, &wfds)) { client_write_deferred(client); client->lastTime = time(NULL); } |