[PATCH 2/4] dix: reference the cursor just once in InitializeSprite()

Frank Binns frank.binns at imgtec.com
Thu Apr 24 03:37:46 PDT 2014


From: Brendan King <brendan.king at imgtec.com>

The new current cursor was being referenced twice, resulting in a
memory leak when the current server generation ended.

Signed-off-by: Frank Binns <frank.binns at imgtec.com>
---
 dix/events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dix/events.c b/dix/events.c
index 125a0ee..046d95c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3237,7 +3237,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
     pCursor = RefCursor(pCursor);
     if (pSprite->current)
         FreeCursor(pSprite->current, None);
-    pSprite->current = RefCursor(pCursor);
+    pSprite->current = pCursor;
 
     if (pScreen) {
         (*pScreen->RealizeCursor) (pDev, pScreen, pSprite->current);
-- 
1.8.5.4.gfdaaaa2



More information about the xorg-devel mailing list