Commit 8400fc6f authored by northteam's avatar northteam

fix a crash bug when networking is down

When networking is down, getaddrinfo will fail leaving pResultList untouched. Calling freeaddrinfo on NULL will result in segment fault.
parent 540ba465
......@@ -55,7 +55,9 @@ HRESULT ResolveHostName(const char* pszHostName, int family, bool fNumericOnly,
Cleanup:
::freeaddrinfo(pResultList);
if (pResultList != NULL) {
::freeaddrinfo(pResultList);
}
return hr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment