Initialize result pointer

This fixes a crash in case getaddrinfo returns an error.
This commit is contained in:
Bernd Buschinski authored and Michał Janiszewski committed 2017-08-20 23:05:16 +02:00
1 parent b89e01de8b
commit 0bb0c3b60f
1 file changed
+1 -1
+1 -1
View File
@@ -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)
{