diff mbox

[12/12] Don't segfault when changing VNC password on an SDL display.

Message ID 1251291946-25821-13-git-send-email-glommer@redhat.com
State Superseded
Headers show

Commit Message

Glauber Costa Aug. 26, 2009, 1:05 p.m. UTC
From: Zachary Amsden <zamsden@redhat.com>

Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 vnc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

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;