mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	multi_backend_destroy: fix trivial use-after-free
This commit is contained in:
		
							parent
							
								
									4f73498b78
								
							
						
					
					
						commit
						844b166c1b
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -30,8 +30,8 @@ static bool multi_backend_start(struct wlr_backend *_backend) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void multi_backend_destroy(struct wlr_backend *_backend) {
 | 
					static void multi_backend_destroy(struct wlr_backend *_backend) {
 | 
				
			||||||
	struct wlr_multi_backend *backend = (struct wlr_multi_backend *)_backend;
 | 
						struct wlr_multi_backend *backend = (struct wlr_multi_backend *)_backend;
 | 
				
			||||||
	struct subbackend_state *sub;
 | 
						struct subbackend_state *sub, *next;
 | 
				
			||||||
	wl_list_for_each(sub, &backend->backends, link) {
 | 
						wl_list_for_each_safe(sub, next, &backend->backends, link) {
 | 
				
			||||||
		wlr_backend_destroy(sub->backend);
 | 
							wlr_backend_destroy(sub->backend);
 | 
				
			||||||
		free(sub);
 | 
							free(sub);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue