don't crash when dns lookup fails (ipv6 path)

we call socket_connect_bail() when getaddrinfo() failed, so it must deal
with no addrinfo being there yet.
This commit is contained in:
Oswald Buddenhagen 2015-09-27 12:13:34 +02:00
parent cda596d530
commit 89dc7592ee

View File

@ -520,7 +520,10 @@ static void
socket_connect_bail( conn_t *conn ) socket_connect_bail( conn_t *conn )
{ {
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
freeaddrinfo( conn->addrs ); if (conn->addrs) {
freeaddrinfo( conn->addrs );
conn->addrs = 0;
}
#endif #endif
free( conn->name ); free( conn->name );
conn->name = 0; conn->name = 0;