From 14304a851a4c05bbab3011d8a368c2af705e61e3 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 17 Jul 2024 12:34:22 +0200 Subject: [PATCH] (!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 --- Xext/xres.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Xext/xres.c b/Xext/xres.c index eb4bdfacd..726fed41a 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -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; }