diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:00:40 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:34:41 +0000 |
commit | 3c1d2fdeff0ed61d86fa7d35cb0a61535d9b2816 (patch) | |
tree | 607732a92eaa17461e7dc6d717c7918eae179983 /record/record.c | |
parent | e0491f470e130147191388168e878e3a7348afaf (diff) |
Record: Remove usage of alloca
Replace with xalloc/xfree.
Diffstat (limited to 'record/record.c')
-rw-r--r-- | record/record.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/record/record.c b/record/record.c index 0ed8f84c2..f580f643e 100644 --- a/record/record.c +++ b/record/record.c @@ -1724,7 +1724,7 @@ RecordRegisterClients(RecordContextPtr pContext, ClientPtr client, xRecordRegist * range for extension replies. */ maxSets = PREDEFSETS + 2 * stuff->nRanges; - si = (SetInfoPtr)ALLOCATE_LOCAL(sizeof(SetInfoRec) * maxSets); + si = (SetInfoPtr)xalloc(sizeof(SetInfoRec) * maxSets); if (!si) { err = BadAlloc; @@ -1931,7 +1931,7 @@ bailout: for (i = 0; i < maxSets; i++) if (si[i].intervals) xfree(si[i].intervals); - DEALLOCATE_LOCAL(si); + xfree(si); } if (pCanonClients && pCanonClients != (XID *)&stuff[1]) xfree(pCanonClients); @@ -2298,7 +2298,7 @@ ProcRecordGetContext(ClientPtr client) /* allocate and initialize space for record range info */ - pRangeInfo = (GetContextRangeInfoPtr)ALLOCATE_LOCAL( + pRangeInfo = (GetContextRangeInfoPtr)xalloc( nRCAPs * sizeof(GetContextRangeInfoRec)); if (!pRangeInfo && nRCAPs > 0) return BadAlloc; @@ -2415,7 +2415,7 @@ bailout: { if (pRangeInfo[i].pRanges) xfree(pRangeInfo[i].pRanges); } - DEALLOCATE_LOCAL(pRangeInfo); + xfree(pRangeInfo); return err; } /* ProcRecordGetContext */ @@ -2815,14 +2815,14 @@ RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec *pci) if (pci->client->swapped) { - char *pConnSetup = (char *)ALLOCATE_LOCAL(prefixsize + restsize); + char *pConnSetup = (char *)xalloc(prefixsize + restsize); if (!pConnSetup) return; SwapConnSetupPrefix(pci->prefix, pConnSetup); SwapConnSetupInfo(pci->setup, pConnSetup + prefixsize); RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, (pointer)pConnSetup, prefixsize + restsize, 0); - DEALLOCATE_LOCAL(pConnSetup); + xfree(pConnSetup); } else { |