From 6664310889f9985c3a0ae391cdf50a0537bfb723 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 17 Nov 2026 20:20:38 +0200
Subject: [PATCH 34/34] kick_command(): Fix 'uninitialized unique_ipaddr'
 -warning

See RM #2493

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 server/stdinhand.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/server/stdinhand.c b/server/stdinhand.c
index 0a34cf3b4c..2611c7a2f0 100644
--- a/server/stdinhand.c
+++ b/server/stdinhand.c
@@ -6369,8 +6369,13 @@ static bool kick_command(struct connection *caller, char *name, bool check)
 
 #define MIN_UNIQUE_CONNS 3
 
-    const char *unique_ipaddr[MIN_UNIQUE_CONNS];
-    int i, num_unique_connections = 0;
+    const char *unique_ipaddr[MIN_UNIQUE_CONNS]
+      /* BAD_HEURISTIC_INIT() does not work here, but this is equivalent */
+#ifndef FREECIV_TESTMATIC
+      = { NULL, NULL, NULL }
+#endif
+      ;
+    int num_unique_connections = 0;
 
     if (pconn == caller) {
       cmd_reply(CMD_KICK, caller, C_FAIL, _("You may not kick yourself."));
@@ -6378,6 +6383,8 @@ static bool kick_command(struct connection *caller, char *name, bool check)
     }
 
     conn_list_iterate(game.est_connections, aconn) {
+      int i;
+
       for (i = 0; i < num_unique_connections; i++) {
         if (0 == strcmp(unique_ipaddr[i], aconn->server.ipaddr)) {
           /* Already listed. */
-- 
2.53.0

