summaryrefslogtreecommitdiff
path: root/xserver/hw/xnest/Screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/hw/xnest/Screen.c')
-rw-r--r--xserver/hw/xnest/Screen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xserver/hw/xnest/Screen.c b/xserver/hw/xnest/Screen.c
index abb4d372d..214b55015 100644
--- a/xserver/hw/xnest/Screen.c
+++ b/xserver/hw/xnest/Screen.c
@@ -158,7 +158,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
if (!dixRegisterPrivateKey(&xnestCursorScreenKeyRec, PRIVATE_SCREEN, 0))
return FALSE;
- visuals = (VisualPtr) malloc(xnestNumVisuals * sizeof(VisualRec));
+ visuals = xallocarray(xnestNumVisuals, sizeof(VisualRec));
numVisuals = 0;
depths = (DepthPtr) malloc(MAXDEPTH * sizeof(DepthRec));
@@ -224,7 +224,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
numVisuals++;
}
- visuals = (VisualPtr) realloc(visuals, numVisuals * sizeof(VisualRec));
+ visuals = reallocarray(visuals, numVisuals, sizeof(VisualRec));
defaultVisual = visuals[xnestDefaultVisualIndex].vid;
rootDepth = visuals[xnestDefaultVisualIndex].nplanes;