commit 4eb89019bb8b325da7fdc590c1194a3e9617f253 Author: Rob Savoye Date: Mon May 21 07:15:09 2012 -0600 don't free ans more than necessary diff --git b/libbase/Socket.cpp a/libbase/Socket.cpp index 2bb3484..6b66984 100644 --- b/libbase/Socket.cpp +++ a/libbase/Socket.cpp @@ -177,7 +177,7 @@ Socket::connect(const std::string& hostname, boost::uint16_t port) code, gai_strerror(code)); return false; } - log_error(_("getaddrinfo() needed to change localhost, check your /etc/hosts file!")); + log_error(_("getaddrinfo() needed to change localhost, edit your /etc/host file!")); } else { log_error(_("getaddrinfo() failed with code: #%d - %s\n"), code, gai_strerror(code)); @@ -253,6 +253,7 @@ Socket::connect(const std::string& hostname, boost::uint16_t port) const int err = errno; log_error(_("Socket creation failed: %s"), std::strerror(err)); _socket = 0; + freeaddrinfo(ans); return false; } } @@ -274,9 +275,11 @@ Socket::connect(const std::string& hostname, boost::uint16_t port) if (err != EINPROGRESS) { log_error(_("Failed to connect to socket: %s"), std::strerror(err)); _socket = 0; + freeaddrinfo(ans); return false; } #else + freeaddrinfo(ans); return false; #endif } @@ -298,7 +301,8 @@ Socket::connect(const std::string& hostname, boost::uint16_t port) reinterpret_cast(&on), sizeof(on)); assert(_socket); - + freeaddrinfo(ans); + return true; }