Skip to contentSkip to conversation

[6616] monitor: Don't change VNC server when disabled (Jan Kiszka)

Qemu-devel Anthony Liguori 1 participant 1 message Feb 11, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 6616

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6616
Author:   aliguori
Date:     2009-02-11 21:00:38 +0000 (Wed, 11 Feb 2009)

Log Message:
-----------
monitor: Don't change VNC server when disabled (Jan Kiszka)

[ As requested, broken out of the monitor rework series. ]

Avoid a segfault when the user issues 'change vnc' without having vnc enabled on startup.

Modified Paths:
--------------
trunk/vnc.c

Modified: trunk/vnc.c
===================================================================

vnc.c +4 -0
@@ -2333,6 +2333,8 @@
 {
     VncState *vs = ds ? (VncState *)ds->opaque : vnc_state;
 
+    if (!vs)
+        return;
     if (vs->display) {
 	qemu_free(vs->display);
 	vs->display = NULL;
@@ -2392,6 +2394,8 @@
     int tls = 0, x509 = 0;
 #endif
 
+    if (!vnc_state)
+        return -1;
     vnc_display_close(ds);
     if (strcmp(display, "none") == 0)
 	return 0;