X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/7bea78ced6f9156a8b5c37c4ae8cb15698ead4cd..734a94a20c7ee4bd787eb434d21d8be1f24f7774:/socket.c diff --git a/socket.c b/socket.c index ccc79cfe..15dea8b8 100644 --- a/socket.c +++ b/socket.c @@ -122,12 +122,14 @@ int try_bind_local(int s, for (r = bres_all; r; r = r->ai_next) { if (bind(s, r->ai_addr, r->ai_addrlen) == -1) continue; + freeaddrinfo(bres_all); return s; } /* no error message; there might be some problem that allows * creation of the socket but not binding, perhaps if the * machine has no ipv6 address of this name. */ + freeaddrinfo(bres_all); return -1; } @@ -329,7 +331,8 @@ static int open_socket_in(int type, int port, const char *bind_address, close(s); continue; } - + + freeaddrinfo(all_ai); return s; }