summaryrefslogtreecommitdiff
path: root/xserver/render/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/render/render.c')
-rw-r--r--xserver/render/render.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xserver/render/render.c b/xserver/render/render.c
index 93e43e7a3..b777991d0 100644
--- a/xserver/render/render.c
+++ b/xserver/render/render.c
@@ -1318,14 +1318,14 @@ ProcRenderCompositeGlyphs(ClientPtr client)
if (nglyph <= NLOCALGLYPH)
glyphsBase = glyphsLocal;
else {
- glyphsBase = (GlyphPtr *) malloc(nglyph * sizeof(GlyphPtr));
+ glyphsBase = xallocarray(nglyph, sizeof(GlyphPtr));
if (!glyphsBase)
return BadAlloc;
}
if (nlist <= NLOCALDELTA)
listsBase = listsLocal;
else {
- listsBase = (GlyphListPtr) malloc(nlist * sizeof(GlyphListRec));
+ listsBase = xallocarray(nlist, sizeof(GlyphListRec));
if (!listsBase) {
rc = BadAlloc;
goto bail;
@@ -1793,7 +1793,7 @@ ProcRenderCreateAnimCursor(ClientPtr client)
ncursor =
(client->req_len -
(bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1;
- cursors = malloc(ncursor * (sizeof(CursorPtr) + sizeof(CARD32)));
+ cursors = xallocarray(ncursor, sizeof(CursorPtr) + sizeof(CARD32));
if (!cursors)
return BadAlloc;
deltas = (CARD32 *) (cursors + ncursor);