pChc is already freed through CursorFreeHideCount →
deleteCursorHideCount.

Signed-off-by: Julien Cristau <jcris...@debian.org>
---
 xfixes/cursor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 5619aad..10f9b23 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -774,10 +774,8 @@ createCursorHideCount(ClientPtr pClient, ScreenPtr pScreen)
      * Create a resource for this element so it can be deleted
      * when the client goes away.
      */
-    if (!AddResource(pChc->resource, CursorHideCountType, (void *) pChc)) {
-        free(pChc);
+    if (!AddResource(pChc->resource, CursorHideCountType, (void *) pChc))
         return BadAlloc;
-    }
 
     return Success;
 }
-- 
2.7.0

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to