mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	And get it right this time... don't leak if it is an empty string either.
This commit is contained in:
		
							
								
								
									
										9
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								format.c
									
									
									
									
									
								
							@@ -357,9 +357,12 @@ format_get_command(struct window_pane *wp)
 | 
			
		||||
 | 
			
		||||
	cmd = get_proc_name(wp->fd, wp->tty);
 | 
			
		||||
	if (cmd == NULL || *cmd == '\0') {
 | 
			
		||||
		cmd = wp->cmd;
 | 
			
		||||
		if (cmd == NULL || *cmd == '\0')
 | 
			
		||||
			cmd = wp->shell;
 | 
			
		||||
		free(cmd);
 | 
			
		||||
		cmd = xstrdup(wp->cmd);
 | 
			
		||||
		if (cmd == NULL || *cmd == '\0') {
 | 
			
		||||
			free(cmd);
 | 
			
		||||
			cmd = xstrdup(wp->shell);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	out = parse_window_name(cmd);
 | 
			
		||||
	free(cmd);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user