summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usbredirserver/usbredirserver.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usbredirserver/usbredirserver.c b/usbredirserver/usbredirserver.c
index 1525f1b..7e063a8 100644
--- a/usbredirserver/usbredirserver.c
+++ b/usbredirserver/usbredirserver.c
@@ -157,6 +157,10 @@ static void run_main_loop(void)
break;
}
}
+ /* usbredirhost_read_guest_data may have detected client disconnect */
+ if (client_fd == -1)
+ break;
+
if (FD_ISSET(client_fd, &writefds)) {
if (usbredirhost_write_guest_data(host)) {
break;