Do not destroy sessions twice, GitHub issue 2889.
authornicm <nicm@openbsd.org>
Fri, 17 Sep 2021 07:20:49 +0000 (07:20 +0000)
committernicm <nicm@openbsd.org>
Fri, 17 Sep 2021 07:20:49 +0000 (07:20 +0000)
usr.bin/tmux/session.c

index 2d06a64..4d0b026 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.89 2021/08/13 06:52:51 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.90 2021/09/17 07:20:49 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -205,6 +205,9 @@ session_destroy(struct session *s, int notify, const char *from)
        struct winlink  *wl;
 
        log_debug("session %s destroyed (%s)", s->name, from);
+
+       if (s->curw == NULL)
+               return;
        s->curw = NULL;
 
        RB_REMOVE(sessions, &sessions, s);