mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Fix a couple of memory leaks, from marcel partap.
This commit is contained in:
		@@ -171,6 +171,8 @@ server_client_lost(struct client *c)
 | 
				
			|||||||
	if (c->cwd != NULL)
 | 
						if (c->cwd != NULL)
 | 
				
			||||||
		xfree(c->cwd);
 | 
							xfree(c->cwd);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						environ_free(&c->environ);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	close(c->ibuf.fd);
 | 
						close(c->ibuf.fd);
 | 
				
			||||||
	imsg_clear(&c->ibuf);
 | 
						imsg_clear(&c->ibuf);
 | 
				
			||||||
	event_del(&c->event);
 | 
						event_del(&c->event);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								status.c
									
									
									
									
									
								
							@@ -551,8 +551,10 @@ status_find_job(struct client *c, char **iptr)
 | 
				
			|||||||
	/* First try in the new tree. */
 | 
						/* First try in the new tree. */
 | 
				
			||||||
	so_find.cmd = cmd;
 | 
						so_find.cmd = cmd;
 | 
				
			||||||
	so = RB_FIND(status_out_tree, &c->status_new, &so_find);
 | 
						so = RB_FIND(status_out_tree, &c->status_new, &so_find);
 | 
				
			||||||
	if (so != NULL && so->out != NULL)
 | 
						if (so != NULL && so->out != NULL) {
 | 
				
			||||||
 | 
							xfree(cmd);
 | 
				
			||||||
		return (so->out);
 | 
							return (so->out);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* If not found at all, start the job and add to the tree. */
 | 
						/* If not found at all, start the job and add to the tree. */
 | 
				
			||||||
	if (so == NULL) {
 | 
						if (so == NULL) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user