Fix freeaddrinfo() on FreeBSD.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 26 Aug 2008 14:55:51 +0000 (16:55 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 26 Aug 2008 14:55:51 +0000 (16:55 +0200)
NEWS
lib/connection.c

diff --git a/NEWS b/NEWS
index 3453a66ce25f225b8143c0079509c84ae58cc03c..c25444ed0e4d5ff6347adb1059c4f70702aa9be3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,9 @@ Ctrlproxy 3.0.8 UNRELEASED
 
        * Don't crash when no argument is specified to STOPLISTENER. (#201)
 
+       * Fix segfault on FreeBSD because it doesn't like freeaddrinfo(NULL). 
+         (#202)
+
   INTERNALS
 
     * Use generic storage for MODEs.
index 5bcdc564997a1e58740d7c3aeeb94b9532a8240b..d0dc400ea3a0511869b7deb49c659e24b92b2494 100644 (file)
@@ -470,7 +470,8 @@ static gboolean connect_current_tcp_server(struct irc_network *s)
        if (error) {
                network_log(LOG_ERROR, s, "Unable to lookup %s:%s %s", 
                                        cs->host, cs->port, gai_strerror(error));
-               freeaddrinfo(addrinfo);
+               if (addrinfo != NULL)
+                       freeaddrinfo(addrinfo);
                return FALSE;
        }