Debugging NULL pointers is significantly easier than random memory.
Plus, if new fields (such as for pointer barriers) are added they may just
be properly initialised.

Signed-off-by: Peter Hutterer <[email protected]>
---

 xfixes/cursor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index a83d0a1..1d03cd3 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -1244,7 +1244,7 @@ XFixesCursorInit (void)
        ScreenPtr       pScreen = screenInfo.screens[i];
        CursorScreenPtr cs;
 
-       cs = (CursorScreenPtr) malloc(sizeof (CursorScreenRec));
+       cs = (CursorScreenPtr) calloc(1, sizeof (CursorScreenRec));
        if (!cs)
            return FALSE;
        Wrap (cs, pScreen, CloseScreen, CursorCloseScreen);
-- 
1.7.3.5

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to