From 19b9a34c4863e668c1221ab6bb6d36967dda0b1e Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 10 Feb 2026 08:28:53 +0000 Subject: [PATCH] Only loop over clients if table actually found, from Conor Taylor in GitHub issue 4848. --- key-bindings.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/key-bindings.c b/key-bindings.c index 5e6449b7..d30c3cdb 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -297,12 +297,12 @@ key_bindings_remove_table(const char *name) table = key_bindings_get_table(name, 0); if (table != NULL) { RB_REMOVE(key_tables, &key_tables, table); + TAILQ_FOREACH(c, &clients, entry) { + if (c->keytable == table) + server_client_set_key_table(c, NULL); + } key_bindings_unref_table(table); } - TAILQ_FOREACH(c, &clients, entry) { - if (c->keytable == table) - server_client_set_key_table(c, NULL); - } } void