]> source.dussan.org Git - tigervnc.git/commitdiff
Fix bad reference counting of the initial randr mode set.
authorPierre Ossman <ossman@cendio.se>
Fri, 24 May 2013 10:35:33 +0000 (10:35 +0000)
committerPierre Ossman <ossman@cendio.se>
Fri, 24 May 2013 10:35:33 +0000 (10:35 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5111 3789f03b-4d11-0410-bbf8-ca57d06f2519

unix/xserver/hw/vnc/xvnc.cc

index abb7121897d6c1ec8eb7df9973575caea2539a8d..0fb099bcda133b9073723645b10db62b20921cc2 100644 (file)
@@ -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;
 }