dix: calloc, not malloc, ValuatorClassRec.

For master devices, the ptraccel code could segfault on free since we'd be
dereferencing random memory. Callocing the valuatorClassRec is the easy fix.
This commit is contained in:
Peter Hutterer 2008-09-18 14:51:15 +09:30
parent f789408f7d
commit e76b5b5e73

View File

@ -1235,7 +1235,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes,
if (!dev)
return FALSE;
valc = (ValuatorClassPtr)xalloc(sizeof(ValuatorClassRec) +
valc = (ValuatorClassPtr)xcalloc(1, sizeof(ValuatorClassRec) +
numAxes * sizeof(AxisInfo) +
numAxes * sizeof(unsigned int));
if (!valc)