AddrInfo: Fix error message generation when node == NULL

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg
2014-01-04 04:18:26 -05:00
parent 5532117984
commit b39da20edc
+1 -1
View File
@@ -207,7 +207,7 @@ public:
res( NULL ) {
int errcode = getaddrinfo( node, service, hints, &res );
if ( errcode != 0 ) {
throw NetworkException( std::string( "Bad IP address (" ) + node + "): " + gai_strerror( errcode ), 0 );
throw NetworkException( std::string( "Bad IP address (" ) + (node != NULL ? node : "(null)") + "): " + gai_strerror( errcode ), 0 );
}
}
~AddrInfo() { freeaddrinfo(res); }