From 0f14f4c9791edf89e11166b2734e9d4f96ec7f86 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 17 Nov 2026 20:20:38 +0200
Subject: [PATCH 75/75] 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 273151d3ed..b81a2fe8fe 100644
--- a/server/stdinhand.c
+++ b/server/stdinhand.c
@@ -6372,8 +6372,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
+      = { nullptr, nullptr, nullptr }
+#endif
+      ;
+    int num_unique_connections = 0;
 
     if (pconn == caller) {
       cmd_reply(CMD_KICK, caller, C_FAIL, _("You may not kick yourself."));
@@ -6381,6 +6386,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

