(!1601) 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.

Note: there's an upper bound by compile time defines (theoretically, can
be increased by special cmdline args, that virtually nobody ever using).

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 3ac32208f6
commit 14304a851a

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;
}