mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Do not add a reference to the session if no session is present.
This commit is contained in:
		| @@ -114,6 +114,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item) | |||||||
|  |  | ||||||
| 	cdata->cwd = xstrdup(server_client_get_cwd(item->client, s)); | 	cdata->cwd = xstrdup(server_client_get_cwd(item->client, s)); | ||||||
| 	cdata->s = s; | 	cdata->s = s; | ||||||
|  | 	if (s != NULL) | ||||||
| 		session_add_ref(s, __func__); | 		session_add_ref(s, __func__); | ||||||
|  |  | ||||||
| 	evtimer_set(&cdata->timer, cmd_run_shell_timer, cdata); | 	evtimer_set(&cdata->timer, cmd_run_shell_timer, cdata); | ||||||
| @@ -203,6 +204,7 @@ cmd_run_shell_free(void *data) | |||||||
| 	struct cmd_run_shell_data	*cdata = data; | 	struct cmd_run_shell_data	*cdata = data; | ||||||
|  |  | ||||||
| 	evtimer_del(&cdata->timer); | 	evtimer_del(&cdata->timer); | ||||||
|  | 	if (cdata->s != NULL) | ||||||
| 		session_remove_ref(cdata->s, __func__); | 		session_remove_ref(cdata->s, __func__); | ||||||
| 	free(cdata->cwd); | 	free(cdata->cwd); | ||||||
| 	free(cdata->cmd); | 	free(cdata->cmd); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 nicm
					nicm