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:
parent
d3499556d8
commit
c9f7b303a3
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue