From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLMcX-0003PG-Qh for qemu-devel@nongnu.org; Thu, 07 Jul 2016 23:38:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLMcT-0005ne-M7 for qemu-devel@nongnu.org; Thu, 07 Jul 2016 23:38:28 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:26203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLMcT-0005lq-20 for qemu-devel@nongnu.org; Thu, 07 Jul 2016 23:38:25 -0400 From: Gonglei Date: Fri, 8 Jul 2016 11:37:36 +0800 Message-ID: <1467949056-81208-1-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] vnc: fix incorrect checking condition when updating client List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, berrange@redhat.com, Gonglei , Haibin Wang 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 Signed-off-by: Gonglei --- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/vnc.c b/ui/vnc.c index 18c0b56..bd602b6 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1025,7 +1025,7 @@ static int find_and_clear_dirty_height(VncState *vs, 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; -- 1.7.12.4