From 2b04fa44a515dd8754e5be83937b5e9e96ef982b Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 24 May 2013 10:35:33 +0000 Subject: [PATCH] Fix bad reference counting of the initial randr mode set. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5111 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/xserver/hw/vnc/xvnc.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc index abb71218..0fb099bc 100644 --- a/unix/xserver/hw/vnc/xvnc.cc +++ b/unix/xserver/hw/vnc/xvnc.cc @@ -1353,6 +1353,7 @@ static Bool vncRandRInit(ScreenPtr pScreen) { RRCrtcPtr crtc; RRModePtr mode; + Bool ret; if (!RRInit()) return FALSE; @@ -1371,8 +1372,11 @@ static Bool vncRandRInit(ScreenPtr pScreen) if (mode == NULL) return FALSE; - vncRandRCrtcSet(pScreen, crtc, mode, 0, 0, RR_Rotate_0, - crtc->numOutputs, crtc->outputs); + ret = vncRandRCrtcSet(pScreen, crtc, mode, 0, 0, RR_Rotate_0, + crtc->numOutputs, crtc->outputs); + RRModeDestroy(mode); + if (!ret) + return FALSE; return TRUE; } -- 2.39.5