aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/touch.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/touch.c')
-rw-r--r--xorg-server/dix/touch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xorg-server/dix/touch.c b/xorg-server/dix/touch.c
index 1eeed78bd..49d16ab37 100644
--- a/xorg-server/dix/touch.c
+++ b/xorg-server/dix/touch.c
@@ -101,7 +101,7 @@ TouchResizeQueue(ClientPtr client, void *closure)
* don't need to do it often */
size = dev->last.num_touches + dev->last.num_touches / 2 + 1;
- tmp = realloc(dev->last.touches, size * sizeof(*dev->last.touches));
+ tmp = reallocarray(dev->last.touches, size, sizeof(*dev->last.touches));
if (tmp) {
int j;
@@ -350,7 +350,7 @@ TouchBeginTouch(DeviceIntPtr dev, int sourceid, uint32_t touchid,
/* If we get here, then we've run out of touches: enlarge dev->touch and
* try again. */
- tmp = realloc(t->touches, (t->num_touches + 1) * sizeof(*ti));
+ tmp = reallocarray(t->touches, t->num_touches + 1, sizeof(*ti));
if (tmp) {
t->touches = tmp;
t->num_touches++;
@@ -547,8 +547,8 @@ TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite)
return FALSE;
if (srcsprite->spriteTraceGood > sprite->spriteTraceSize) {
- trace = realloc(sprite->spriteTrace,
- srcsprite->spriteTraceSize * sizeof(*trace));
+ trace = reallocarray(sprite->spriteTrace,
+ srcsprite->spriteTraceSize, sizeof(*trace));
if (!trace) {
sprite->spriteTraceGood = 0;
return FALSE;