mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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 <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user