summaryrefslogtreecommitdiffstats
path: root/libvncserver
diff options
context:
space:
mode:
authorAmandeep Singh <[email protected]>2013-10-09 04:12:08 +0530
committerMartin T. H. Sandsmark <[email protected]>2014-08-03 14:07:00 +0200
commitafd1d329ed117f6e4d8c46eba362b7d5c51184ac (patch)
treea0beb628f9468c376d81547f8daa456597ff10ba /libvncserver
parentdca1048239b5f3b973a847a21de1ee83c92f6631 (diff)
downloadlibtdevnc-afd1d329ed117f6e4d8c46eba362b7d5c51184ac.tar.gz
libtdevnc-afd1d329ed117f6e4d8c46eba362b7d5c51184ac.zip
Fix crash in krfb
Krfb crashes on quit, if any client is connected due to a rfbClientConnectionGone call missing
Diffstat (limited to 'libvncserver')
-rw-r--r--libvncserver/main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libvncserver/main.c b/libvncserver/main.c
index 4cb18ac..b8cdde1 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -1061,10 +1061,13 @@ void rfbShutdownServer(rfbScreenInfoPtr screen,rfbBool disconnectClients) {
if(disconnectClients) {
rfbClientPtr cl;
rfbClientIteratorPtr iter = rfbGetClientIterator(screen);
- while( (cl = rfbClientIteratorNext(iter)) )
- if (cl->sock > -1)
- /* we don't care about maxfd here, because the server goes away */
- rfbCloseClient(cl);
+ while( (cl = rfbClientIteratorNext(iter)) ) {
+ if (cl->sock > -1) {
+ /* we don't care about maxfd here, because the server goes away */
+ rfbCloseClient(cl);
+ rfbClientConnectionGone(cl);
+ }
+ }
rfbReleaseClientIterator(iter);
}