dix: don't alloc in ChangeMasterDeviceClasses.

We mustn't realloc as we are inside a signal handler. With
SetMinimumEventSize, this code should never be hit anyway, as the event list
should have the required memory before this code is hit.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
This commit is contained in:
Peter Hutterer 2008-11-25 20:23:50 +10:00 • committed by Peter Hutterer
commit aeff14d5f2
2 changed files with 6 additions and 20 deletions

View file

@ -119,25 +119,6 @@ CreateClassesChangedEvent(EventList* event,
deviceClassesChangedEvent *dcce;
int len = sizeof(xEvent);
CARD32 ms = GetTimeInMillis();
int namelen = 0; /* dummy */
/* XXX: ok, this is a bit weird. We need to alloc enough size for the
* event so it can be filled in in POE lateron. Reason being that if
* we realloc the event in POE we can get SIGABRT when we try to free
* or realloc the original pointer.
* We can only do it here as we don't have the EventList in the event
* processing any more.
*/
SizeDeviceInfo(slave, &namelen, &len);
if (event->evlen < len)
{
event->event = realloc(event->event, len);
if (!event->event)
FatalError("[dix] Cannot allocate memory for "
"DeviceClassesChangedEvent.\n");
event->evlen = len;
}
dcce = (deviceClassesChangedEvent*)event->event;
dcce->type = GenericEvent;