diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-02-11 13:50:10 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-02-14 09:13:19 +1000 |
commit | c9f7b303a36ca501c6ecf1196c266ee8e8f49d2d (patch) | |
tree | df71fcb1510f6abe5dd98670e671fc977f2ac0cd | |
parent | d3499556d8d83396fa2585bd00371a81e086be36 (diff) |
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>
-rw-r--r-- | xfixes/cursor.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |