From patchwork Sun Oct 14 13:08:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tim Hardeck X-Patchwork-Id: 191349 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2E4D12C0095 for ; Mon, 15 Oct 2012 00:09:46 +1100 (EST) Received: from localhost ([::1]:43197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNNwu-0002gD-0K for incoming@patchwork.ozlabs.org; Sun, 14 Oct 2012 09:09:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNNwg-0002fo-6P for qemu-devel@nongnu.org; Sun, 14 Oct 2012 09:09:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNNwe-000112-JF for qemu-devel@nongnu.org; Sun, 14 Oct 2012 09:09:30 -0400 Received: from cantor2.suse.de ([195.135.220.15]:54586 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNNwe-00010O-Aa for qemu-devel@nongnu.org; Sun, 14 Oct 2012 09:09:28 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 1A663A2FD6 for ; Sun, 14 Oct 2012 15:09:27 +0200 (CEST) From: Tim Hardeck To: qemu-devel@nongnu.org Date: Sun, 14 Oct 2012 15:08:47 +0200 Message-Id: <1350220128-10140-2-git-send-email-thardeck@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1350220128-10140-1-git-send-email-thardeck@suse.de> References: <1350220128-10140-1-git-send-email-thardeck@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Tim Hardeck Subject: [Qemu-devel] [PATCH 1/2] vnc: fix segfault due to failed handshake X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When the VNC server disconnects due to a failed handshake we don't have vs->bh allocated yet. Check for this case and don't delete it. Signed-off-by: Tim Hardeck Acked-by: Andreas Färber --- ui/vnc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/vnc.c b/ui/vnc.c index 01b2daf..656895a 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1055,7 +1055,9 @@ static void vnc_disconnect_finish(VncState *vs) vnc_unlock_output(vs); qemu_mutex_destroy(&vs->output_mutex); - qemu_bh_delete(vs->bh); + if (vs->bh != NULL) { + qemu_bh_delete(vs->bh); + } buffer_free(&vs->jobs_buffer); for (i = 0; i < VNC_STAT_ROWS; ++i) {