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