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 bf5130d6a7dbc8f86662b96126dcba9671ba44b1..753229b4fd01e90887e45118b0965697ab28c65c 100644 (file)
@@ -300,7 +300,8 @@ begin:
        }
 
        if(!c->outgoing->aip) {
        }
 
        if(!c->outgoing->aip) {
-               freeaddrinfo(c->outgoing->ai);
+               if(c->outgoing->ai)
+                       freeaddrinfo(c->outgoing->ai);
                c->outgoing->ai = NULL;
                goto begin;
        }
                c->outgoing->ai = NULL;
                goto begin;
        }