aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/dmx/input/dmxmotion.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/dmx/input/dmxmotion.c')
-rw-r--r--xorg-server/hw/dmx/input/dmxmotion.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/xorg-server/hw/dmx/input/dmxmotion.c b/xorg-server/hw/dmx/input/dmxmotion.c
index 1642894a2..7f2cb8ed9 100644
--- a/xorg-server/hw/dmx/input/dmxmotion.c
+++ b/xorg-server/hw/dmx/input/dmxmotion.c
@@ -113,9 +113,8 @@ dmxPointerPutMotionEvent(DeviceIntPtr pDevice,
int i;
if (!dmxLocal->history) {
- dmxLocal->history = malloc(sizeof(*dmxLocal->history)
- * (numAxes + 1)
- * DMX_MOTION_SIZE);
+ dmxLocal->history = xallocarray(numAxes + 1,
+ sizeof(*dmxLocal->history) * DMX_MOTION_SIZE);
dmxLocal->head = 0;
dmxLocal->tail = 0;
dmxLocal->valuators = calloc(sizeof(*dmxLocal->valuators), numAxes);