From 89dc7592eea3f7b2804c2ec09f58c877ad096fef Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sun, 27 Sep 2015 12:13:34 +0200 Subject: [PATCH] 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. --- src/socket.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/socket.c b/src/socket.c index 5c1ce93..9fd6eca 100644 --- a/src/socket.c +++ b/src/socket.c @@ -520,7 +520,10 @@ static void socket_connect_bail( conn_t *conn ) { #ifdef HAVE_IPV6 - freeaddrinfo( conn->addrs ); + if (conn->addrs) { + freeaddrinfo( conn->addrs ); + conn->addrs = 0; + } #endif free( conn->name ); conn->name = 0;