Prevent freeing a NULL pointer when a hostname is unresolvable.
authorGuus Sliepen <guus@tinc-vpn.org>
Tue, 18 Nov 2008 15:11:27 +0000 (15:11 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 18 Nov 2008 15:11:27 +0000 (15:11 +0000)
src/net_socket.c

index bf5130d..753229b 100644 (file)
@@ -300,7 +300,8 @@ begin:
        }
 
        if(!c->outgoing->aip) {
-               freeaddrinfo(c->outgoing->ai);
+               if(c->outgoing->ai)
+                       freeaddrinfo(c->outgoing->ai);
                c->outgoing->ai = NULL;
                goto begin;
        }