(!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:
		
							parent
							
								
									8ddabaa8f1
								
							
						
					
					
						commit
						032200f1de
					
				|  | @ -216,12 +216,11 @@ ProcXResQueryVersion(ClientPtr client) | ||||||
| static int | static int | ||||||
| ProcXResQueryClients(ClientPtr client) | ProcXResQueryClients(ClientPtr client) | ||||||
| { | { | ||||||
|     int *current_clients; |  | ||||||
|     int i, num_clients = 0; |     int i, num_clients = 0; | ||||||
| 
 | 
 | ||||||
|     REQUEST_SIZE_MATCH(xXResQueryClientsReq); |     REQUEST_SIZE_MATCH(xXResQueryClientsReq); | ||||||
| 
 | 
 | ||||||
|     current_clients = xallocarray(currentMaxClients, sizeof(int)); |     int current_clients[currentMaxClients]; | ||||||
| 
 | 
 | ||||||
|     for (i = 0; i < currentMaxClients; i++) { |     for (i = 0; i < currentMaxClients; i++) { | ||||||
|         if (clients[i]) { |         if (clients[i]) { | ||||||
|  | @ -258,8 +257,6 @@ ProcXResQueryClients(ClientPtr client) | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     free(current_clients); |  | ||||||
| 
 |  | ||||||
|     return Success; |     return Success; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue