From: nicm Date: Fri, 17 Sep 2021 07:20:49 +0000 (+0000) Subject: Do not destroy sessions twice, GitHub issue 2889. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b2f27a60c8b99edfd213140c5e20cf94757551f2;p=openbsd Do not destroy sessions twice, GitHub issue 2889. --- diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c index 2d06a64712c..4d0b0262889 100644 --- a/usr.bin/tmux/session.c +++ b/usr.bin/tmux/session.c @@ -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 @@ -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);