summaryrefslogtreecommitdiff
path: root/usbredirserver/usbredirserver.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-07-31 11:37:24 +0200
committerHans de Goede <hdegoede@redhat.com>2012-07-31 11:37:24 +0200
commit54ea0cc9a8c1ae015d2209c93fa2973e36654516 (patch)
tree2da3838f44a1a01cd8b70bc4218def03facbe1e7 /usbredirserver/usbredirserver.c
parentb1bfc5fbaf08840f499ba1890f4751dbd85e8e79 (diff)
usbredirserver: Fix a crash on client disconnect
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'usbredirserver/usbredirserver.c')
-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;