Xi: plug memory leak, free previous motion history before allocating new.

This commit is contained in:
Peter Hutterer 2008-04-09 07:46:53 +09:30 committed by Who-T
parent ea05cf0813
commit 60c38d248c

View File

@ -390,6 +390,8 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
if (from->valuator)
{
ValuatorClassPtr v;
if (to->valuator)
xfree(to->valuator->motion);
to->valuator = xrealloc(to->valuator, sizeof(ValuatorClassRec) +
from->valuator->numAxes * sizeof(AxisInfo) +
from->valuator->numAxes * sizeof(unsigned int));