From 0bb0c3b60f291f79707b7f2be30e055da07c8d9c Mon Sep 17 00:00:00 2001 From: Bernd Buschinski Date: Sun, 20 Aug 2017 22:38:36 +0200 Subject: [PATCH] Initialize result pointer This fixes a crash in case getaddrinfo returns an error. --- src/openrct2/network/TcpSocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/network/TcpSocket.cpp b/src/openrct2/network/TcpSocket.cpp index 4c00859902..c33b560918 100644 --- a/src/openrct2/network/TcpSocket.cpp +++ b/src/openrct2/network/TcpSocket.cpp @@ -449,7 +449,7 @@ private: hints.ai_flags = AI_PASSIVE; } - addrinfo * result; + addrinfo * result = nullptr; getaddrinfo(address, serviceName.c_str(), &hints, &result); if (result == nullptr) {