mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Don't call tty_free unless the client is a terminal, otherwise tty_init hasn't
been called and it may end up doing close(0). From Kalle Olavi Niemitalo.
This commit is contained in:
		
							
								
								
									
										5
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								server.c
									
									
									
									
									
								
							@@ -915,6 +915,11 @@ server_lost_client(struct client *c)
 | 
			
		||||
	}
 | 
			
		||||
	log_debug("lost client %d", c->ibuf.fd);
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * If CLIENT_TERMINAL hasn't been set, then tty_init hasn't been called
 | 
			
		||||
	 * and tty_free might close an unrelated fd.
 | 
			
		||||
	 */
 | 
			
		||||
	if (c->flags & CLIENT_TERMINAL)
 | 
			
		||||
		tty_free(&c->tty);
 | 
			
		||||
 | 
			
		||||
	screen_free(&c->status);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user