With csh, a tmux client gets SIGTERM before SIGCONT when killed with

"kill %%", so when the client tells the server it got SIGCONT, don't use
bits that may already have been freed when it got SIGTERM. Also don't
print anything on exit if we get SIGTERM while suspended. Reported by
Theo.
This commit is contained in:
nicm
2020-10-30 18:54:23 +00:00
parent 9726c4454e
commit 95841ba16a
2 changed files with 8 additions and 3 deletions

View File

@ -2025,7 +2025,7 @@ server_client_dispatch(struct imsg *imsg, void *arg)
break;
c->flags &= ~CLIENT_SUSPENDED;
if (c->fd == -1) /* exited in the meantime */
if (c->fd == -1 || c->session == NULL) /* exited already */
break;
s = c->session;