mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Fix leak in format_get_command.
This commit is contained in:
		
							
								
								
									
										6
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								format.c
									
									
									
									
									
								
							@@ -353,7 +353,7 @@ format_expand(struct format_tree *ft, const char *fmt)
 | 
				
			|||||||
char *
 | 
					char *
 | 
				
			||||||
format_get_command(struct window_pane *wp)
 | 
					format_get_command(struct window_pane *wp)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	char	*cmd;
 | 
						char	*cmd, *out;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	cmd = get_proc_name(wp->fd, wp->tty);
 | 
						cmd = get_proc_name(wp->fd, wp->tty);
 | 
				
			||||||
	if (cmd == NULL || *cmd == '\0') {
 | 
						if (cmd == NULL || *cmd == '\0') {
 | 
				
			||||||
@@ -361,7 +361,9 @@ format_get_command(struct window_pane *wp)
 | 
				
			|||||||
		if (cmd == NULL || *cmd == '\0')
 | 
							if (cmd == NULL || *cmd == '\0')
 | 
				
			||||||
			cmd = wp->shell;
 | 
								cmd = wp->shell;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return (parse_window_name(cmd));
 | 
						out = parse_window_name(cmd);
 | 
				
			||||||
 | 
						free(cmd);
 | 
				
			||||||
 | 
						return (out);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Set default format keys for a session. */
 | 
					/* Set default format keys for a session. */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user