From 31c93c483afa4f94ef2091c8d9f25db4731d0e7f 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. --- control.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/control.c b/control.c index 00544aa1..e4efb01f 100644 --- a/control.c +++ b/control.c @@ -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); }