mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
xcmisc: ProcXCMiscGetXIDList(): declare variables where used first
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
f8fd9f7287
commit
f50b238fe1
@@ -94,20 +94,17 @@ static int
|
||||
ProcXCMiscGetXIDList(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXCMiscGetXIDListReq);
|
||||
xXCMiscGetXIDListReply rep;
|
||||
XID *pids;
|
||||
unsigned int count;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
|
||||
|
||||
if (stuff->count > UINT32_MAX / sizeof(XID))
|
||||
return BadAlloc;
|
||||
|
||||
pids = calloc(stuff->count, sizeof(XID));
|
||||
XID *pids = calloc(stuff->count, sizeof(XID));
|
||||
if (!pids) {
|
||||
return BadAlloc;
|
||||
}
|
||||
count = GetXIDList(client, stuff->count, pids);
|
||||
|
||||
size_t count = GetXIDList(client, stuff->count, pids);
|
||||
|
||||
struct x_rpcbuf rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
|
||||
@@ -117,7 +114,7 @@ ProcXCMiscGetXIDList(ClientPtr client)
|
||||
if (rpcbuf.error)
|
||||
return BadAlloc;
|
||||
|
||||
rep = (xXCMiscGetXIDListReply) {
|
||||
xXCMiscGetXIDListReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = count,
|
||||
|
||||
Reference in New Issue
Block a user