diff options
| author | Don Lewis <truckman@FreeBSD.org> | 2016-06-01 17:43:04 +0000 |
|---|---|---|
| committer | Don Lewis <truckman@FreeBSD.org> | 2016-06-01 17:43:04 +0000 |
| commit | dee32aa9c81200154b95b8c3af36e6003b6b8f5f (patch) | |
| tree | 889e64fc276750e7b2a068db2449317811833cba /lib/libfetch | |
| parent | 15fe2c59b0be8500d7a4901ffcc75de6378e1bdb (diff) | |
Notes
Diffstat (limited to 'lib/libfetch')
| -rw-r--r-- | lib/libfetch/common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 76dc4f9206eb..6ae99268f6ea 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -256,8 +256,11 @@ fetch_bind(int sd, int af, const char *addr) if ((err = getaddrinfo(addr, NULL, &hints, &res0)) != 0) return (-1); for (res = res0; res; res = res->ai_next) - if (bind(sd, res->ai_addr, res->ai_addrlen) == 0) + if (bind(sd, res->ai_addr, res->ai_addrlen) == 0) { + freeaddrinfo(res0); return (0); + } + freeaddrinfo(res0); return (-1); } |
