(!1601) Xext: xres: ProcXResQueryClientResources(): put temporary int array on stack
Simplify allocaton by putting the small temporary int array onto stack. This also allows further simplifications by upcoming commits. The upper bound is determined by the number of resource types registered in the server - this can only be increased by writing new extensions. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
924540c44d
commit
97ef16e966
|
@ -294,7 +294,6 @@ ProcXResQueryClientResources(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
|
||||
|
||||
int i, clientID, num_types = 0;
|
||||
int *counts;
|
||||
|
||||
clientID = CLIENT_ID(stuff->xid);
|
||||
|
||||
|
@ -303,7 +302,8 @@ ProcXResQueryClientResources(ClientPtr client)
|
|||
return BadValue;
|
||||
}
|
||||
|
||||
counts = calloc(lastResourceType + 1, sizeof(int));
|
||||
int counts[lastResourceType + 1];
|
||||
memset(counts, 0, sizeof(counts));
|
||||
|
||||
FindAllClientResources(clients[clientID], ResFindAllRes, counts);
|
||||
|
||||
|
@ -344,8 +344,6 @@ ProcXResQueryClientResources(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
free(counts);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue