X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fio%2Fsg_socket.cxx;h=905639b91d2c01f437dbe9a01d2b9827246f5658;hb=a66d1ad8552e910adb72d442177e2c9f21660857;hp=144c64dfa8a9b75802fa34a1713dc8b6a41bc25d;hpb=557fade4a7df3f030b943ba6114c3c566c57b73c;p=simgear.git diff --git a/simgear/io/sg_socket.cxx b/simgear/io/sg_socket.cxx index 144c64df..905639b9 100644 --- a/simgear/io/sg_socket.cxx +++ b/simgear/io/sg_socket.cxx @@ -132,6 +132,10 @@ SGSocket::SocketType SGSocket::make_client_socket () { // get the hosts official name/info hp = gethostbyname( hostname.c_str() ); + if (hp == NULL) { + SG_LOG( SG_IO, SG_ALERT, "Error: hostname lookup failed" ); + return INVALID_SOCKET; + } // Connect this socket to the host and the port specified on the // command line