summaryrefslogtreecommitdiff
path: root/hw/vfb
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-03-21 17:23:33 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-04-21 16:58:08 -0700
commitae2dc01cf1a371db69d5deb987f4185e7c3ccedd (patch)
tree3ebc9b59da385b07b6cf9c9f763b2b16208029da /hw/vfb
parent4cb1034906eeec8c8442d70918bea0f4eb1f6e44 (diff)
Convert hw/xnest & hw/vfb to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'hw/vfb')
-rw-r--r--hw/vfb/InitOutput.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index bcaaa85e4..8b867e3b9 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -292,7 +292,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
if (vfbNumScreens <= screenNum) {
vfbScreens =
- realloc(vfbScreens, sizeof(*vfbScreens) * (screenNum + 1));
+ reallocarray(vfbScreens, screenNum + 1, sizeof(*vfbScreens));
if (!vfbScreens)
FatalError("Not enough memory for screen %d\n", screenNum);
for (; vfbNumScreens <= screenNum; ++vfbNumScreens)
@@ -407,9 +407,9 @@ vfbInstallColormap(ColormapPtr pmap)
swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
- ppix = (Pixel *) malloc(entries * sizeof(Pixel));
- prgb = (xrgb *) malloc(entries * sizeof(xrgb));
- defs = (xColorItem *) malloc(entries * sizeof(xColorItem));
+ ppix = xallocarray(entries, sizeof(Pixel));
+ prgb = xallocarray(entries, sizeof(xrgb));
+ defs = xallocarray(entries, sizeof(xColorItem));
for (i = 0; i < entries; i++)
ppix[i] = i;