From c9f7b303a36ca501c6ecf1196c266ee8e8f49d2d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 11 Feb 2011 13:50:10 +1000 Subject: xfixes: calloc, not malloc the cursorScreenRec Debugging NULL pointers is significantly easier than random memory. Plus, if new fields (such as pointer barriers) are added they may just be properly initialised. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- xfixes/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 54e5d755e..fb608f694 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -1045,7 +1045,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); -- cgit v1.2.3