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>
This commit is contained in:
Zachary Amsden 2009-07-30 00:15:00 -10:00 committed by Anthony Liguori
parent 9075000958
commit 7ef923310a

4
vnc.c
View File

@ -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;