AddrInfo: Fix error message generation when node == NULL
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
@@ -207,7 +207,7 @@ public:
|
|||||||
res( NULL ) {
|
res( NULL ) {
|
||||||
int errcode = getaddrinfo( node, service, hints, &res );
|
int errcode = getaddrinfo( node, service, hints, &res );
|
||||||
if ( errcode != 0 ) {
|
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); }
|
~AddrInfo() { freeaddrinfo(res); }
|
||||||
|
|||||||
Reference in New Issue
Block a user