Repository: mesos Updated Branches: refs/heads/master c24268f13 -> d59fb3822
Removed bad call to freeaddrinfo in net::hostname. Review: https://reviews.apache.org/r/34438 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/08e11d37 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/08e11d37 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/08e11d37 Branch: refs/heads/master Commit: 08e11d372afbb66907130998b485c185687fae34 Parents: c24268f Author: Chi Zhang <[email protected]> Authored: Tue May 19 15:03:23 2015 -0700 Committer: Benjamin Mahler <[email protected]> Committed: Tue May 19 15:05:02 2015 -0700 ---------------------------------------------------------------------- 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/08e11d37/3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp index 23d086b..cf0090b 100644 --- a/3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp +++ b/3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp @@ -146,14 +146,11 @@ inline Try<std::string> hostname() // TODO(evelinad): Add AF_UNSPEC when we will support IPv6 struct addrinfo hints = createAddrInfo(SOCK_STREAM, AF_INET, AI_CANONNAME); - struct addrinfo *result; + struct addrinfo* result = NULL; int error = getaddrinfo(host, NULL, &hints, &result); - if (error != 0 || result == NULL) { - if (result != NULL) { - freeaddrinfo(result); - } + if (error != 0) { return Error(gai_strerror(error)); }
