Skip to content

Commit

Permalink
Fixed crash on attempt to send stats without network connection
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Mar 17, 2018
1 parent b4d3715 commit ecff13a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/d_stats.cpp
Expand Up @@ -57,6 +57,11 @@ bool I_HTTPRequest(const char* request)
SOCKET Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
struct hostent *host;
host = gethostbyname(sys_statshost.GetHumanString());
if (host == nullptr)
{
DPrintf(DMSG_ERROR, "Error looking up hostname.\n");
return false;
}
SOCKADDR_IN SockAddr;
SockAddr.sin_port = htons(sys_statsport);
SockAddr.sin_family = AF_INET;
Expand Down

0 comments on commit ecff13a

Please sign in to comment.