From patchwork Wed Aug 26 13:05:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 32169 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id E4181B7093 for ; Thu, 27 Aug 2009 03:32:37 +1000 (EST) Received: from localhost ([127.0.0.1]:58210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgMMK-00065g-VY for incoming@patchwork.ozlabs.org; Wed, 26 Aug 2009 13:32:32 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgLwj-0002U1-D9 for qemu-devel@nongnu.org; Wed, 26 Aug 2009 13:06:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgLwd-0002Lc-Af for qemu-devel@nongnu.org; Wed, 26 Aug 2009 13:06:04 -0400 Received: from [199.232.76.173] (port=45786 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgLwc-0002LK-UU for qemu-devel@nongnu.org; Wed, 26 Aug 2009 13:05:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38880) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgLwc-0000Z5-5j for qemu-devel@nongnu.org; Wed, 26 Aug 2009 13:05:58 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7QH5vs2028951; Wed, 26 Aug 2009 13:05:57 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7QH5kJv009197; Wed, 26 Aug 2009 13:05:56 -0400 From: Glauber Costa To: qemu-devel@nongnu.org Date: Wed, 26 Aug 2009 09:05:46 -0400 Message-Id: <1251291946-25821-13-git-send-email-glommer@redhat.com> In-Reply-To: <1251291946-25821-12-git-send-email-glommer@redhat.com> References: <1251291946-25821-1-git-send-email-glommer@redhat.com> <1251291946-25821-2-git-send-email-glommer@redhat.com> <1251291946-25821-3-git-send-email-glommer@redhat.com> <1251291946-25821-4-git-send-email-glommer@redhat.com> <1251291946-25821-5-git-send-email-glommer@redhat.com> <1251291946-25821-6-git-send-email-glommer@redhat.com> <1251291946-25821-7-git-send-email-glommer@redhat.com> <1251291946-25821-8-git-send-email-glommer@redhat.com> <1251291946-25821-9-git-send-email-glommer@redhat.com> <1251291946-25821-10-git-send-email-glommer@redhat.com> <1251291946-25821-11-git-send-email-glommer@redhat.com> <1251291946-25821-12-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com, Zachary Amsden Subject: [Qemu-devel] [PATCH 12/12] Don't segfault when changing VNC password on an SDL display. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zachary Amsden Signed-off-by: Zachary Amsden Signed-off-by: Anthony Liguori Signed-off-by: Glauber Costa --- vnc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/vnc.c b/vnc.c index c0700c0..1652029 100644 --- a/vnc.c +++ b/vnc.c @@ -2438,6 +2438,10 @@ int vnc_display_password(DisplayState *ds, const char *password) { VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; + if (!vs) { + return -1; + } + if (vs->password) { qemu_free(vs->password); vs->password = NULL;