Commit b9f48d60 authored by Committed by Keith Packard
Device init: Don't crash when CreateGC fails.
ActivateDevice was ignoring errors from DeviceCursorInitialize, so cursor-related calls failed later. Jeremy Huddleston saw that crash in miPointerConstrainCursor, while with Xvfb I saw it in miSpriteRealizeCursor. miDCDeviceCleanup frees any non-NULL GCs. miDCDeviceInitialize calls Cleanup on any failure, but if it failed early then some of the pointers in the miDCBufferPtr were garbage. Switch from malloc to calloc to ensure everything's initialized safely first. With these two fixes, if CreateGC fails then the server gracefully fails in FatalError instead of segfaulting. Signed-off-by: Jamey Sharp <email@example.com> Cc: Peter Hutterer <firstname.lastname@example.org> Reviewed-by: Peter Hutterer <email@example.com> Signed-off-by: Keith Packard <firstname.lastname@example.org>
Showing with 3 additions and 2 deletions