(cleanup/xext-xres) Xext: xres: ProcXResQueryClients() 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.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-07-17 12:34:22 +02:00
parent ea5e05f4cb
commit 61533fdf1e

View File

@@ -216,12 +216,11 @@ ProcXResQueryVersion(ClientPtr client)
static int
ProcXResQueryClients(ClientPtr client)
{
int *current_clients;
int i, num_clients = 0;
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
current_clients = xallocarray(currentMaxClients, sizeof(int));
int current_clients[currentMaxClients];
for (i = 0; i < currentMaxClients; i++) {
if (clients[i]) {
@@ -258,8 +257,6 @@ ProcXResQueryClients(ClientPtr client)
}
}
free(current_clients);
return Success;
}