From: Stefano Stabellini Date: Mon, 11 Jan 2010 17:30:50 +0000 (+0000) Subject: vnc_refresh: return if vd->timer is NULL X-Git-Tag: v0.13.0-rc0~1730 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=83755c173f4608764e3ee92428247d1c5e962e6a;p=qemu.git vnc_refresh: return if vd->timer is NULL Hi all, calling vnc_update_client in vnc_refresh might have the unlikely side effect of setting vd->timer = NULL, if the last vnc client disconnected. In this case we have to return from vnc_refresh without updating the timer, otherwise we cause a segfault. Signed-off-by: Stefano Stabellini Signed-off-by: Anthony Liguori --- diff --git a/vnc.c b/vnc.c index c54c6e070..58eac73f9 100644 --- a/vnc.c +++ b/vnc.c @@ -2305,6 +2305,10 @@ static void vnc_refresh(void *opaque) rects += vnc_update_client(vs, has_dirty); vs = vs->next; } + /* vd->timer could be NULL now if the last client disconnected, + * in this case don't update the timer */ + if (vd->timer == NULL) + return; if (has_dirty && rects) { vd->timer_interval /= 2;