mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Do not leak formats in status_replace.
This commit is contained in:
		
							
								
								
									
										6
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								status.c
									
									
									
									
									
								
							@@ -503,7 +503,7 @@ status_replace(struct client *c, struct session *s, struct winlink *wl,
 | 
				
			|||||||
    struct window_pane *wp, const char *fmt, time_t t, int jobsflag)
 | 
					    struct window_pane *wp, const char *fmt, time_t t, int jobsflag)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	static char		 out[BUFSIZ];
 | 
						static char		 out[BUFSIZ];
 | 
				
			||||||
	char			 in[BUFSIZ], ch, *iptr, *optr;
 | 
						char			 in[BUFSIZ], ch, *iptr, *optr, *expanded;
 | 
				
			||||||
	size_t			 len;
 | 
						size_t			 len;
 | 
				
			||||||
	struct format_tree	*ft;
 | 
						struct format_tree	*ft;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -542,7 +542,9 @@ status_replace(struct client *c, struct session *s, struct winlink *wl,
 | 
				
			|||||||
	format_session(ft, s);
 | 
						format_session(ft, s);
 | 
				
			||||||
	format_winlink(ft, s, wl);
 | 
						format_winlink(ft, s, wl);
 | 
				
			||||||
	format_window_pane(ft, wp);
 | 
						format_window_pane(ft, wp);
 | 
				
			||||||
	return (format_expand(ft, out));
 | 
					    expanded = format_expand(ft, out);
 | 
				
			||||||
 | 
					    format_free(ft);
 | 
				
			||||||
 | 
					    return (expanded);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Figure out job name and get its result, starting it off if necessary. */
 | 
					/* Figure out job name and get its result, starting it off if necessary. */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user