summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;