diff --git a/src/i_tcp.c b/src/i_tcp.c
index 739355ccf87273cf05875312e15ce0c6dee8a1a2..f8a65b754becc94aa0d4c76c03216b92db080e5f 100644
--- a/src/i_tcp.c
+++ b/src/i_tcp.c
@@ -1310,7 +1310,7 @@ void I_ShutdownTcpDriver(void)
 static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port)
 {
 	SINT8 newnode = -1;
-	struct my_addrinfo *ai, *runp, hints;
+	struct my_addrinfo *ai = NULL, *runp, hints;
 	int gaie;
 
 	 if (!port || !port[0])