summaryrefslogtreecommitdiff
path: root/vnc.c
diff options
context:
space:
mode:
authorZachary Amsden <zamsden@redhat.com>2009-07-30 00:15:00 -1000
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-24 08:01:40 -0500
commit7ef923310a73b8de3e1a07e901b62a2c50dd36be (patch)
treec8e62a4fe1ff68388457b1479346fb9f3976b3d7 /vnc.c
parentFix detached migration with exec. (diff)
downloadqemu-kvm-7ef923310a73b8de3e1a07e901b62a2c50dd36be.tar.gz
qemu-kvm-7ef923310a73b8de3e1a07e901b62a2c50dd36be.tar.bz2
qemu-kvm-7ef923310a73b8de3e1a07e901b62a2c50dd36be.zip
Don't segfault when changing VNC password on an SDL display.
Signed-off-by: Zachary Amsden <zamsden@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vnc.c b/vnc.c
index 4fde9aae5..9dbe82ac0 100644
--- a/vnc.c
+++ b/vnc.c
@@ -2263,6 +2263,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;