summaryrefslogtreecommitdiff
path: root/hw/dmx/input/dmxmotion.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-03-21 17:59:13 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-04-21 16:58:08 -0700
commit0018784cdde19444a8f970bc414796fc2a523a51 (patch)
tree779eb85d61f1ef33485fea8783b0d7f7080d2276 /hw/dmx/input/dmxmotion.c
parentdc5acaa28ab9ed091f087e56046400d63f1f192a (diff)
Convert hw/dmx to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'hw/dmx/input/dmxmotion.c')
-rw-r--r--hw/dmx/input/dmxmotion.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/dmx/input/dmxmotion.c b/hw/dmx/input/dmxmotion.c
index 1642894a2..7f2cb8ed9 100644
--- a/hw/dmx/input/dmxmotion.c
+++ b/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);