dix: sprite may be NULL, don't dereference it then.

In some rare cases (e.g. when the init fails) a device's sprite is NULL,
dereferencing it to xfree the spriteTrace is a bad idea then.
This commit is contained in:
Peter Hutterer 2008-04-06 09:02:57 +09:30
parent 638a50552e
commit b46a009186

View File

@ -873,7 +873,7 @@ CloseDevice(DeviceIntPtr dev)
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
#endif
if (DevHasCursor(dev)) {
if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
xfree(dev->spriteInfo->sprite->spriteTrace);
xfree(dev->spriteInfo->sprite);
}