aboutsummaryrefslogtreecommitdiff
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-27 21:23:39 -0500
commitaf0f38c5df8522d2f67edf6edcdab83572f58c8d (patch)
tree8e4a034f49fdb6ebb243562441ebd99db7e1464c
parenta5435be94307d08d143b2b4c2ee68055cd10cf58 (diff)
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>
-rw-r--r--vnc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vnc.c b/vnc.c
index a50ee0c1ef..d79dfd9a3a 100644
--- a/vnc.c
+++ b/vnc.c
@@ -2182,6 +2182,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;