RandR: Remove usage of alloca

Replace with heap allocations.
This commit is contained in:
Daniel Stone 2007-11-05 14:01:11 +00:00
parent 3c1d2fdeff
commit 2d738efb95

View File

@ -386,7 +386,7 @@ ProcRRListOutputProperties (ClientPtr client)
for (prop = output->properties; prop; prop = prop->next) for (prop = output->properties; prop; prop = prop->next)
numProps++; numProps++;
if (numProps) if (numProps)
if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) if(!(pAtoms = (Atom *)xalloc(numProps * sizeof(Atom))))
return(BadAlloc); return(BadAlloc);
rep.type = X_Reply; rep.type = X_Reply;
@ -408,7 +408,7 @@ ProcRRListOutputProperties (ClientPtr client)
{ {
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
DEALLOCATE_LOCAL(pAtoms); xfree(pAtoms);
} }
return(client->noClientException); return(client->noClientException);
} }