mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-03 12:50:14 +01: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:
parent
d3499556d8
commit
c9f7b303a3
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Reference in a new issue