mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Merge pull request #2091 from martinetd/config-block-use-after-free
sway/config: fix use-after-free for end of block
This commit is contained in:
		
						commit
						5b72e8606c
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -626,13 +626,13 @@ bool read_config(FILE *file, struct sway_config *config) {
 | 
			
		|||
				success = false;
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			wlr_log(L_DEBUG, "Exiting block '%s'", block);
 | 
			
		||||
			list_del(stack, 0);
 | 
			
		||||
			free(block);
 | 
			
		||||
 | 
			
		||||
			if (strcmp(block, "bar") == 0) {
 | 
			
		||||
				config->current_bar = NULL;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			wlr_log(L_DEBUG, "Exiting block '%s'", block);
 | 
			
		||||
			list_del(stack, 0);
 | 
			
		||||
			free(block);
 | 
			
		||||
			memset(&config->handler_context, 0,
 | 
			
		||||
					sizeof(config->handler_context));
 | 
			
		||||
		default:;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue