mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	I made a complete horlicks of the last change, fix it so it doesn't either lead
to a double free or free the item after the end of the array.
This commit is contained in:
		@@ -151,10 +151,6 @@ cmd_string_parse(const char *s, struct cmd_list **cmdlist, char **cause)
 | 
			
		||||
			if (*cmdlist == NULL)
 | 
			
		||||
				goto out;
 | 
			
		||||
 | 
			
		||||
			do
 | 
			
		||||
				xfree(argv[argc - 1]);
 | 
			
		||||
			while (--argc > 0);
 | 
			
		||||
 | 
			
		||||
			rval = 0;
 | 
			
		||||
			goto out;
 | 
			
		||||
		case '~':
 | 
			
		||||
@@ -189,7 +185,7 @@ out:
 | 
			
		||||
 | 
			
		||||
	if (argv != NULL) {
 | 
			
		||||
		for (i = 0; i < argc; i++)
 | 
			
		||||
			xfree(argv[argc]);
 | 
			
		||||
			xfree(argv[i]);
 | 
			
		||||
		xfree(argv);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user