summaryrefslogtreecommitdiff
path: root/dix/swaprep.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2007-11-05 14:12:59 +0000
committerDaniel Stone <daniel@fooishbar.org>2007-11-05 14:34:43 +0000
commit914922fd6100a409a3dfd1c64511ed6bdc344bef (patch)
tree9d073014ac8bc779832aa98619ca54536927fa05 /dix/swaprep.c
parent3b77689266e729411229ec83d2a90578ebc1d82f (diff)
DIX: Remove usage of alloca
Replace with heap allocations.
Diffstat (limited to 'dix/swaprep.c')
-rw-r--r--dix/swaprep.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/dix/swaprep.c b/dix/swaprep.c
index 7d3251ae3..91469e17b 100644
--- a/dix/swaprep.c
+++ b/dix/swaprep.c
@@ -101,7 +101,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
CARD32 tmpbuf[1];
/* Allocate as big a buffer as we can... */
- while (!(pbufT = (CARD32 *) ALLOCATE_LOCAL(bufsize)))
+ while (!(pbufT = (CARD32 *) xalloc(bufsize)))
{
bufsize >>= 1;
if (bufsize == 4)
@@ -133,7 +133,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
}
if (pbufT != tmpbuf)
- DEALLOCATE_LOCAL ((char *) pbufT);
+ xfree ((char *) pbufT);
}
/**
@@ -149,7 +149,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
short tmpbuf[2];
/* Allocate as big a buffer as we can... */
- while (!(pbufT = (short *) ALLOCATE_LOCAL(bufsize)))
+ while (!(pbufT = (short *) xalloc(bufsize)))
{
bufsize >>= 1;
if (bufsize == 4)
@@ -181,7 +181,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
}
if (pbufT != tmpbuf)
- DEALLOCATE_LOCAL ((char *) pbufT);
+ xfree ((char *) pbufT);
}
@@ -1267,7 +1267,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
{
char *pInfoTBase;
- pInfoTBase = (char *) ALLOCATE_LOCAL(size);
+ pInfoTBase = (char *) xalloc(size);
if (!pInfoTBase)
{
pClient->noClientException = -1;
@@ -1275,7 +1275,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
}
SwapConnSetupInfo(pInfo, pInfoTBase);
(void)WriteToClient(pClient, (int)size, (char *) pInfoTBase);
- DEALLOCATE_LOCAL(pInfoTBase);
+ xfree(pInfoTBase);
}
_X_EXPORT void