]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
vnc: fix incorrect checking condition when updating client
authorGonglei <arei.gonglei@huawei.com>
Fri, 8 Jul 2016 03:37:36 +0000 (11:37 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 28 Sep 2016 15:50:25 +0000 (10:50 -0500)
vs->disconnecting is set to TRUE and vs->ioc is closed, but
vs->ioc isn't set to NULL, so that the vnc_disconnect_finish()
isn't invoked when you update client in vnc_update_client()
after vnc_disconnect_start invoked. Let's using change the checking
condition to avoid resource leak.

Signed-off-by: Haibin Wang <wanghaibin.wang@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1467949056-81208-1-git-send-email-arei.gonglei@huawei.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 5a693efda84d7df5136cc2bd31c959bb1530b0c9)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
ui/vnc.c

index 59bbacba76a96498c9fed60b81462b000cbbb154..1d41c0f4f8f8a5291ab03ed55f94b68a0cb61f40 100644 (file)
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1041,7 +1041,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
     }
 
     vs->has_dirty += has_dirty;
-    if (vs->need_update && vs->ioc != NULL) {
+    if (vs->need_update && !vs->disconnecting) {
         VncDisplay *vd = vs->vd;
         VncJob *job;
         int y;