qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] monitor: Don't change VNC server when disabled


From: Anthony Liguori
Subject: [Qemu-devel] Re: [PATCH] monitor: Don't change VNC server when disabled
Date: Wed, 11 Feb 2009 15:01:59 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Jan Kiszka wrote:
[ As requested, broken out of the monitor rework series. ]

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

Signed-off-by: Jan Kiszka <address@hidden>

Applied.  Thanks.

Regards,

Anthony Liguori

---

 vnc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/vnc.c b/vnc.c
index 68df599..bdfc79b 100644
--- a/vnc.c
+++ b/vnc.c
@@ -2333,6 +2333,8 @@ void vnc_display_close(DisplayState *ds)
 {
     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 vnc_display_open(DisplayState *ds, const char 
*display)
     int tls = 0, x509 = 0;
 #endif
+ if (!vnc_state)
+        return -1;
     vnc_display_close(ds);
     if (strcmp(display, "none") == 0)
        return 0;







reply via email to

[Prev in Thread] Current Thread [Next in Thread]