Commit 733d4206 authored by Daniel Stone's avatar Daniel Stone
Browse files

XFree86: Remove usage of alloca

Replace with heap allocations.
parent caf54506
......@@ -823,7 +823,7 @@ DoConfigure()
homebuf[PATH_MAX-1] = '\0';
home = homebuf;
if (!(filename =
(char *)ALLOCATE_LOCAL(strlen(home) +
(char *)xalloc(strlen(home) +
strlen(configfile) + 3)))
if (home[0] == '/' && home[1] == '\0')
......
......@@ -622,7 +622,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
int i, index;
sbusCmapPtr cmap;
struct fbcmap fbcmap;
unsigned char *data = ALLOCATE_LOCAL(numColors*3);
unsigned char *data = xalloc(numColors*3);
cmap = SBUSCMAPPTR(pScrn->pScreen);
if (!cmap) return;
......@@ -643,7 +643,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
fbcmap.blue[fbcmap.count++] = colors[index].blue;
}
ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap);
DEALLOCATE_LOCAL(data);
xfree(data);
}
static Bool
......
......@@ -1856,7 +1856,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
REGION_TRANSLATE(pDraw->pScreen, clipboxes, -pDraw->x, -pDraw->y);
rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle));
rects = xalloc(nbox * sizeof(xRectangle));
for(i = 0; i < nbox; i++, pbox++) {
rects[i].x = pbox->x1;
......@@ -1869,7 +1869,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
if (!pPriv) FreeGC(pGC, 0);
DEALLOCATE_LOCAL(rects);
xfree(rects);
}
_X_EXPORT void
......
......@@ -1323,14 +1323,14 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.nhsync = nHsync;
rep.nvsync = nVrefresh;
hsyncdata = ALLOCATE_LOCAL(nHsync * sizeof(CARD32));
hsyncdata = xalloc(nHsync * sizeof(CARD32));
if (!hsyncdata) {
return BadAlloc;
}
vsyncdata = ALLOCATE_LOCAL(nVrefresh * sizeof(CARD32));
vsyncdata = xalloc(nVrefresh * sizeof(CARD32));
if (!vsyncdata) {
DEALLOCATE_LOCAL(hsyncdata);
xfree(hsyncdata);
return BadAlloc;
}
......@@ -1363,8 +1363,8 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
if (rep.modelLength)
WriteToClient(client, rep.modelLength, (char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr);
DEALLOCATE_LOCAL(hsyncdata);
DEALLOCATE_LOCAL(vsyncdata);
xfree(hsyncdata);
xfree(vsyncdata);
return (client->noClientException);
}
......@@ -1448,11 +1448,11 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
rep.flags = 0;
if (!ClockProg) {
Clocks = ALLOCATE_LOCAL(numClocks * sizeof(int));
Clocks = xalloc(numClocks * sizeof(int));
if (!Clocks)
return BadValue;
if (!VidModeGetClocks(stuff->screen, Clocks)) {
DEALLOCATE_LOCAL(Clocks);
xfree(Clocks);
return BadValue;
}
}
......@@ -1479,7 +1479,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
}
}
DEALLOCATE_LOCAL(Clocks);
xfree(Clocks);
return (client->noClientException);
}
......
......@@ -636,7 +636,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc)
DisplayModePtr mode = &crtc->mode;
Bool ret;
randr_outputs = ALLOCATE_LOCAL(config->num_output * sizeof (RROutputPtr));
randr_outputs = xalloc(config->num_output * sizeof (RROutputPtr));
if (!randr_outputs)
return FALSE;
x = crtc->x;
......@@ -671,7 +671,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc)
}
ret = RRCrtcNotify (randr_crtc, randr_mode, x, y,
rotation, numOutputs, randr_outputs);
DEALLOCATE_LOCAL(randr_outputs);
xfree(randr_outputs);
return ret;
}
......@@ -726,7 +726,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
xf86CrtcPtr *save_crtcs;
Bool save_enabled = crtc->enabled;
save_crtcs = ALLOCATE_LOCAL(config->num_output * sizeof (xf86CrtcPtr));
save_crtcs = xalloc(config->num_output * sizeof (xf86CrtcPtr));
if ((randr_mode != NULL) != crtc->enabled)
changed = TRUE;
else if (randr_mode && !xf86RandRModeMatches (randr_mode, &crtc->mode))
......@@ -782,7 +782,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
xf86OutputPtr output = config->output[o];
output->crtc = save_crtcs[o];
}
DEALLOCATE_LOCAL(save_crtcs);
xfree(save_crtcs);
return FALSE;
}
/*
......@@ -795,7 +795,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
}
xf86DisableUnusedFunctions (pScrn);
}
DEALLOCATE_LOCAL(save_crtcs);
xfree(save_crtcs);
return xf86RandR12CrtcNotify (randr_crtc);
}
......@@ -938,8 +938,8 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen)
RRCrtcPtr randr_crtc;
int nclone;
clones = ALLOCATE_LOCAL(config->num_output * sizeof (RROutputPtr));
crtcs = ALLOCATE_LOCAL (config->num_crtc * sizeof (RRCrtcPtr));
clones = xalloc(config->num_output * sizeof (RROutputPtr));
crtcs = xalloc (config->num_crtc * sizeof (RRCrtcPtr));
for (o = 0; o < config->num_output; o++)
{
xf86OutputPtr output = config->output[o];
......@@ -956,8 +956,8 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen)
if (!RROutputSetCrtcs (output->randr_output, crtcs, ncrtc))
{
DEALLOCATE_LOCAL (crtcs);
DEALLOCATE_LOCAL (clones);
xfree (crtcs);
xfree (clones);
return FALSE;
}
......@@ -993,13 +993,13 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen)
}
if (!RROutputSetClones (output->randr_output, clones, nclone))
{
DEALLOCATE_LOCAL (crtcs);
DEALLOCATE_LOCAL (clones);
xfree (crtcs);
xfree (clones);
return FALSE;
}
}
DEALLOCATE_LOCAL (crtcs);
DEALLOCATE_LOCAL (clones);
xfree (crtcs);
xfree (clones);
return TRUE;
}
......
......@@ -1035,7 +1035,7 @@ ShadowPolyRectangle(
offset1 = offset2 >> 1;
offset3 = offset2 - offset1;
pBoxInit = (BoxPtr)ALLOCATE_LOCAL(nRects * 4 * sizeof(BoxRec));
pBoxInit = (BoxPtr)xalloc(nRects * 4 * sizeof(BoxRec));
pbox = pBoxInit;
while(nRects--) {
......@@ -1086,7 +1086,7 @@ ShadowPolyRectangle(
if(pPriv->preRefresh)
(*pPriv->preRefresh)(pPriv->pScrn, num, pBoxInit);
} else {
DEALLOCATE_LOCAL(pBoxInit);
xfree(pBoxInit);
}
}
}
......@@ -1098,7 +1098,7 @@ ShadowPolyRectangle(
} else if(num) {
if(pPriv->postRefresh)
(*pPriv->postRefresh)(pPriv->pScrn, num, pBoxInit);
DEALLOCATE_LOCAL(pBoxInit);
xfree(pBoxInit);
}
SHADOW_GC_OP_EPILOGUE(pGC);
......
......@@ -236,9 +236,9 @@ vgaInstallColormap(pmap)
else
entries = pmap->pVisual->ColormapEntries;
ppix = (Pixel *)ALLOCATE_LOCAL( entries * sizeof(Pixel));
prgb = (xrgb *)ALLOCATE_LOCAL( entries * sizeof(xrgb));
defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
ppix = (Pixel *)xalloc( entries * sizeof(Pixel));
prgb = (xrgb *)xalloc( entries * sizeof(xrgb));
defs = (xColorItem *)xalloc(entries * sizeof(xColorItem));
if ( oldmap != NOMAPYET)
WalkTree( pmap->pScreen, TellLostMap, &oldmap->mid);
......@@ -261,9 +261,9 @@ vgaInstallColormap(pmap)
WalkTree(pmap->pScreen, TellGainedMap, &pmap->mid);
DEALLOCATE_LOCAL(ppix);
DEALLOCATE_LOCAL(prgb);
DEALLOCATE_LOCAL(defs);
xfree(ppix);
xfree(prgb);
xfree(defs);
}
......
......@@ -186,7 +186,7 @@ XAABitBlt(
/* Do bit blitting */
numRects = REGION_NUM_RECTS(&rgnDst);
if (numRects && width && height) {
if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
if(!(pptSrc = (DDXPointPtr)xalloc(numRects *
sizeof(DDXPointRec)))) {
REGION_UNINIT(pGC->pScreen, &rgnDst);
if (freeSrcClip)
......@@ -201,7 +201,7 @@ XAABitBlt(
}
(*doBitBlt) (pSrcDrawable, pDstDrawable, pGC, &rgnDst, pptSrc);
DEALLOCATE_LOCAL(pptSrc);
xfree(pptSrc);
}
prgnExposed = NULL;
......
......@@ -108,12 +108,12 @@ XAADoBitBlt(
if (nbox > 1) {
/* keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
if(!pboxNew1)
return;
pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox);
if(!pptNew1) {
DEALLOCATE_LOCAL(pboxNew1);
xfree(pboxNew1);
return;
}
pboxBase = pboxNext = pbox+nbox-1;
......@@ -145,14 +145,14 @@ XAADoBitBlt(
if (nbox > 1) {
/* reverse order of rects in each band */
pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox);
if(!pboxNew2 || !pptNew2) {
if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
if (pptNew2) xfree(pptNew2);
if (pboxNew2) xfree(pboxNew2);
if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1);
DEALLOCATE_LOCAL(pboxNew1);
xfree(pptNew1);
xfree(pboxNew1);
}
return;
}
......@@ -183,12 +183,12 @@ XAADoBitBlt(
xdir, ydir, pGC->alu, pGC->planemask);
if (pboxNew2) {
DEALLOCATE_LOCAL(pptNew2);
DEALLOCATE_LOCAL(pboxNew2);
xfree(pptNew2);
xfree(pboxNew2);
}
if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1);
DEALLOCATE_LOCAL(pboxNew1);
xfree(pptNew1);
xfree(pboxNew1);
}
}
......
......@@ -59,7 +59,7 @@ XAACopyWindow(
pbox = REGION_RECTS(&rgnDst);
nbox = REGION_NUM_RECTS(&rgnDst);
if(!nbox ||
!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
!(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) {
REGION_UNINIT(pScreen, &rgnDst);
return;
}
......@@ -77,6 +77,6 @@ XAACopyWindow(
XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
&(infoRec->ScratchGC), &rgnDst, pptSrc);
DEALLOCATE_LOCAL(pptSrc);
xfree(pptSrc);
REGION_UNINIT(pScreen, &rgnDst);
}
......@@ -291,7 +291,7 @@ PolyGlyphBltAsSingleBitmap (
pitch = (Right - Left + 31) >> 5;
size = (pitch << 2) * (Bottom - Top);
block = (CARD32*)ALLOCATE_LOCAL(size);
block = (CARD32*)xalloc(size);
bzero(block, size);
topLine = 10000; botLine = -10000;
......@@ -350,7 +350,7 @@ PolyGlyphBltAsSingleBitmap (
nbox--; pbox++;
}
DEALLOCATE_LOCAL(block);
xfree(block);
}
static void
......
......@@ -69,7 +69,7 @@ XAACopyWindow8_32(
pbox = REGION_RECTS(&rgnDst);
nbox = REGION_NUM_RECTS(&rgnDst);
if(!nbox ||
!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
!(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) {
REGION_UNINIT(pScreen, &rgnDst);
return;
}
......@@ -87,7 +87,7 @@ XAACopyWindow8_32(
XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
&(infoRec->ScratchGC), &rgnDst, pptSrc);
DEALLOCATE_LOCAL(pptSrc);
xfree(pptSrc);
REGION_UNINIT(pScreen, &rgnDst);
if(freeReg)
REGION_DESTROY(pScreen, borderClip);
......
......@@ -358,7 +358,7 @@ XAAOverCopyWindow(
nbox = REGION_NUM_RECTS(&rgnDst);
if(nbox &&
(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) {
pbox = REGION_RECTS(&rgnDst);
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
......@@ -376,7 +376,7 @@ XAAOverCopyWindow(
&(infoRec->ScratchGC), &rgnDst, pptSrc);
}
DEALLOCATE_LOCAL(pptSrc);
xfree(pptSrc);
}
REGION_UNINIT(pScreen, &rgnDst);
......@@ -388,7 +388,7 @@ XAAOverCopyWindow(
REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
nbox = REGION_NUM_RECTS(&rgnDst);
if(nbox &&
(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))){
(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))){
pbox = REGION_RECTS(&rgnDst);
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
......@@ -399,7 +399,7 @@ XAAOverCopyWindow(
SWITCH_DEPTH(pScrn->depth);
XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
&(infoRec->ScratchGC), &rgnDst, pptSrc);
DEALLOCATE_LOCAL(pptSrc);
xfree(pptSrc);
}
}
REGION_UNINIT(pScreen, &rgnDst);
......
......@@ -1557,7 +1557,7 @@ XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
pad = BitmapBytePad(pCache->w * bpp);
dwords = pad >> 2;
dstPtr = data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
dstPtr = data = (unsigned char*)xalloc(pad * pCache->h);
srcPtr = (unsigned char*)pPix->devPrivate.ptr;
if(infoRec->ScreenToScreenColorExpandFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
......@@ -1588,7 +1588,7 @@ XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data,
pad, bpp, pScrn->depth);
DEALLOCATE_LOCAL(data);
xfree(data);
return pCache;
}
......@@ -1967,7 +1967,7 @@ XAAWriteMono8x8PatternToCache(
pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel);
data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
data = (unsigned char*)xalloc(pad * pCache->h);
if(!data) return;
if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
......@@ -1991,7 +1991,7 @@ XAAWriteMono8x8PatternToCache(
(*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y,
pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth);
DEALLOCATE_LOCAL(data);
xfree(data);
}
void
......@@ -2012,7 +2012,7 @@ XAAWriteColor8x8PatternToCache(
if(pixPriv->flags & REDUCIBLE_TO_2_COLOR) {
CARD32* ptr;
pad = BitmapBytePad(pCache->w);
data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
data = (unsigned char*)xalloc(pad * pCache->h);
if(!data) return;
if(infoRec->Color8x8PatternFillFlags &
......@@ -2037,7 +2037,7 @@ XAAWriteColor8x8PatternToCache(
(*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y,
pCache->w, pCache->h, data, pad, pCache->fg, pCache->bg);
DEALLOCATE_LOCAL(data);
xfree(data);
return;
}
......@@ -2046,7 +2046,7 @@ XAAWriteColor8x8PatternToCache(
w = min(8,pPix->drawable.width);
pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel);
data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
data = (unsigned char*)xalloc(pad * pCache->h);
if(!data) return;
/* Write and expand horizontally. */
......@@ -2085,7 +2085,7 @@ XAAWriteColor8x8PatternToCache(
(*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y,
pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth);
DEALLOCATE_LOCAL(data);
xfree(data);
}
......
......@@ -471,7 +471,7 @@ XAACompositeSrcCopy (PicturePtr pSrc,
REGION_UNINIT(pScreen, &region);
return;
}
pptSrc = ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
pptSrc = xalloc(sizeof(DDXPointRec) * nbox);
if (!pptSrc) {
REGION_UNINIT(pScreen, &region);
return;
......@@ -489,7 +489,7 @@ XAACompositeSrcCopy (PicturePtr pSrc,
XAADoBitBlt(pSrc->pDrawable, pDst->pDrawable, &infoRec->ScratchGC, &region,
pptSrc);
DEALLOCATE_LOCAL(pptSrc);
xfree(pptSrc);
REGION_UNINIT(pScreen, &region);
return;
}
......
......@@ -301,7 +301,7 @@ EXPNAME(XAATEGlyphRenderer3)(
}
dwords = ((3 * w + 31) >> 5) * h;
mem = (CARD32*)ALLOCATE_LOCAL(((w + 31) >> 3) * sizeof(char));
mem = (CARD32*)xalloc(((w + 31) >> 3) * sizeof(char));
if (!mem) return;
(*infoRec->SubsequentCPUToScreenColorExpandFill)(pScrn, x, y, w, h, 0);
......@@ -321,7 +321,7 @@ EXPNAME(XAATEGlyphRenderer3)(
DrawTextScanline3(base, mem, w);
}
DEALLOCATE_LOCAL(mem);
xfree(mem);
if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
(dwords & 1)) {
......@@ -478,7 +478,7 @@ EXPNAME(XAATEGlyphRendererScanline3)(
w += skipleft;
x -= skipleft;
mem = (CARD32*)ALLOCATE_LOCAL(((w + 31) >> 3) * sizeof(char));
mem = (CARD32*)xalloc(((w + 31) >> 3) * sizeof(char));
if (!mem) return;
(*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
......@@ -495,7 +495,7 @@ EXPNAME(XAATEGlyphRendererScanline3)(
bufferNo = 0;
}
DEALLOCATE_LOCAL(mem);
xfree(mem);
THE_END:
......
......@@ -355,7 +355,7 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop)
int getWidth; /* bits to get from glyph */
#endif
if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS))))
if(!(ppos = (TEXTPOS *)xalloc(nglyph * sizeof(TEXTPOS))))
return;
pdstBase = pdstBase + (widthDst * y) + (x >> PWSH);
......@@ -494,7 +494,7 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop)
}
} /* for each glyph */
} /* while nbox-- */
DEALLOCATE_LOCAL(ppos);
xfree(ppos);
break;
}
default:
......
......@@ -110,13 +110,13 @@ vga16DoBitblt
if (nbox > 1)
{
/* keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
if(!pboxNew1)
return;
pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox);
if(!pptNew1)
{
DEALLOCATE_LOCAL(pboxNew1);
xfree(pboxNew1);
return;
}
pboxBase = pboxNext = pbox+nbox-1;
......@@ -146,16 +146,16 @@ vga16DoBitblt
if (nbox > 1)
{
/* reverse order of rects in each band */
pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox);
if(!pboxNew2 || !pptNew2)
{
if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
if (pptNew2) xfree(pptNew2);
if (pboxNew2) xfree(pboxNew2);
if (pboxNew1)
{
DEALLOCATE_LOCAL(pptNew1);
DEALLOCATE_LOCAL(pboxNew1);
xfree(pptNew1);
xfree(pboxNew1);
}
return;
}
......@@ -207,13 +207,13 @@ vga16DoBitblt
}
if (pboxNew2)
{
DEALLOCATE_LOCAL(pptNew2);
DEALLOCATE_LOCAL(pboxNew2);
xfree(pptNew2);
xfree(pboxNew2);
}
if (pboxNew1)
{
DEALLOCATE_LOCAL(pptNew1);
DEALLOCATE_LOCAL(pboxNew1);
xfree(pptNew1);
xfree(pboxNew1);
}
}
......@@ -430,7 +430,7 @@ int dstx, dsty;
numRects = REGION_NUM_RECTS(&rgnDst);
if (numRects && width && height)
{
if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
if(!(pptSrc = (DDXPointPtr)xalloc(numRects *
sizeof(DDXPointRec))))
{
REGION_UNINIT(pGC->pScreen, &rgnDst);
......@@ -448,7 +448,7 @@ int dstx, dsty;
vga16DoBitblt(pSrcDrawable, pDstDrawable, pGC->alu,