summaryrefslogtreecommitdiff
path: root/xserver/mi/micopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/mi/micopy.c')
-rw-r--r--xserver/mi/micopy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xserver/mi/micopy.c b/xserver/mi/micopy.c
index 2409c7880..12cdad4ad 100644
--- a/xserver/mi/micopy.c
+++ b/xserver/mi/micopy.c
@@ -62,7 +62,7 @@ miCopyRegion(DrawablePtr pSrcDrawable,
if (nbox > 1) {
/* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr) malloc(sizeof(BoxRec) * nbox);
+ pboxNew1 = xallocarray(nbox, sizeof(BoxRec));
if (!pboxNew1)
return;
pboxBase = pboxNext = pbox + nbox - 1;
@@ -93,7 +93,7 @@ miCopyRegion(DrawablePtr pSrcDrawable,
if (nbox > 1) {
/* reverse order of rects in each band */
- pboxNew2 = (BoxPtr) malloc(sizeof(BoxRec) * nbox);
+ pboxNew2 = xallocarray(nbox, sizeof(BoxRec));
if (!pboxNew2) {
free(pboxNew1);
return;