From 8faa725573f3b97155eece7122c5f15effbea0c6 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 14 Apr 2026 08:32:30 +0000 Subject: [PATCH] Another check for partially initialized control client, from Matt Koscica in GitHub issue 5004. --- usr.bin/tmux/control.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.bin/tmux/control.c b/usr.bin/tmux/control.c index 6e0e0312498..844d24c0f5e 100644 --- a/usr.bin/tmux/control.c +++ b/usr.bin/tmux/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.52 2026/03/09 14:33:55 nicm Exp $ */ +/* $OpenBSD: control.c,v 1.53 2026/04/14 08:32:30 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott @@ -829,6 +829,9 @@ control_stop(struct client *c) struct control_block *cb, *cb1; struct control_sub *csub, *csub1; + if (cs == NULL) + return; + if (~c->flags & CLIENT_CONTROLCONTROL) bufferevent_free(cs->write_event); bufferevent_free(cs->read_event); @@ -842,6 +845,7 @@ control_stop(struct client *c) control_free_block(cs, cb); control_reset_offsets(c); + c->control_state = NULL; free(cs); }