diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:12:59 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:34:43 +0000 |
commit | 914922fd6100a409a3dfd1c64511ed6bdc344bef (patch) | |
tree | 9d073014ac8bc779832aa98619ca54536927fa05 /dix/property.c | |
parent | 3b77689266e729411229ec83d2a90578ebc1d82f (diff) |
DIX: Remove usage of alloca
Replace with heap allocations.
Diffstat (limited to 'dix/property.c')
-rw-r--r-- | dix/property.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/dix/property.c b/dix/property.c index e281dd765..994d3a7a5 100644 --- a/dix/property.c +++ b/dix/property.c @@ -122,7 +122,7 @@ ProcRotateProperties(ClientPtr client) if (!stuff->nAtoms) return(Success); atoms = (Atom *) & stuff[1]; - props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr)); + props = (PropertyPtr *)xalloc(stuff->nAtoms * sizeof(PropertyPtr)); if (!props) return(BadAlloc); for (i = 0; i < stuff->nAtoms; i++) @@ -131,19 +131,19 @@ ProcRotateProperties(ClientPtr client) DixReadAccess|DixWriteAccess); if (!ValidAtom(atoms[i]) || (XaceErrorOperation == action)) { - DEALLOCATE_LOCAL(props); + xfree(props); client->errorValue = atoms[i]; return BadAtom; } if (XaceIgnoreOperation == action) { - DEALLOCATE_LOCAL(props); + xfree(props); return Success; } for (j = i + 1; j < stuff->nAtoms; j++) if (atoms[j] == atoms[i]) { - DEALLOCATE_LOCAL(props); + xfree(props); return BadMatch; } pProp = wUserProps (pWin); @@ -153,7 +153,7 @@ ProcRotateProperties(ClientPtr client) goto found; pProp = pProp->next; } - DEALLOCATE_LOCAL(props); + xfree(props); return BadMatch; found: props[i] = pProp; @@ -175,7 +175,7 @@ found: props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms]; } } - DEALLOCATE_LOCAL(props); + xfree(props); return Success; } @@ -575,7 +575,7 @@ ProcListProperties(ClientPtr client) numProps++; } if (numProps) - if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) + if(!(pAtoms = (Atom *)xalloc(numProps * sizeof(Atom)))) return(BadAlloc); xlpr.type = X_Reply; @@ -594,7 +594,7 @@ ProcListProperties(ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - DEALLOCATE_LOCAL(pAtoms); + xfree(pAtoms); } return(client->noClientException); } |