From fbf4c261f4f71042da71c91acd0c26c48c697085 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 11 Jul 2011 18:15:51 -0700 Subject: [PATCH] Move freeaddrinfo() call after failure-reporting loop. --- socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socket.c b/socket.c index c19412d2..86e62f9d 100644 --- a/socket.c +++ b/socket.c @@ -299,7 +299,6 @@ int open_socket_out(char *host, int port, const char *bind_addr, } break; } - freeaddrinfo(res0); if (s < 0) { char buf[2048]; @@ -313,6 +312,7 @@ int open_socket_out(char *host, int port, const char *bind_addr, s = -1; } + freeaddrinfo(res0); free(errnos); return s; -- 2.11.4.GIT