From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWSjY-00056Y-Qy for qemu-devel@nongnu.org; Thu, 30 Jul 2009 06:19:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWSjU-000527-U3 for qemu-devel@nongnu.org; Thu, 30 Jul 2009 06:19:36 -0400 Received: from [199.232.76.173] (port=34903 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWSjU-00051u-HC for qemu-devel@nongnu.org; Thu, 30 Jul 2009 06:19:32 -0400 Received: from mx2.redhat.com ([66.187.237.31]:41331) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MWSjT-0008A4-WB for qemu-devel@nongnu.org; Thu, 30 Jul 2009 06:19:32 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6UAJVOY002732 for ; Thu, 30 Jul 2009 06:19:31 -0400 From: Zachary Amsden Date: Thu, 30 Jul 2009 00:15:00 -1000 Message-Id: <1248948912-7877-3-git-send-email-zamsden@redhat.com> In-Reply-To: <1248948912-7877-2-git-send-email-zamsden@redhat.com> References: <1248948912-7877-1-git-send-email-zamsden@redhat.com> <1248948912-7877-2-git-send-email-zamsden@redhat.com> Subject: [Qemu-devel] [PATCH 02/14] Don't segfault when changing VNC password on an SDL display. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: zamsden@redhat.com Signed-off-by: Zachary Amsden --- vnc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/vnc.c b/vnc.c index de0ff87..af485a1 100644 --- a/vnc.c +++ b/vnc.c @@ -2160,6 +2160,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; -- 1.6.2.5