From: Zachary Amsden Date: Thu, 30 Jul 2009 10:15:00 +0000 (-1000) Subject: Don't segfault when changing VNC password on an SDL display. X-Git-Tag: v0.11.0-rc2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af0f38c5df8522d2f67edf6edcdab83572f58c8d;p=thirdparty%2Fqemu.git Don't segfault when changing VNC password on an SDL display. Signed-off-by: Zachary Amsden Signed-off-by: Anthony Liguori --- diff --git a/vnc.c b/vnc.c index a50ee0c1ef5..d79dfd9a3a4 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;