summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/common.c5
-rw-r--r--lib/libfetch/file.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index 76dc4f9..6ae9926 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);
}
diff --git a/lib/libfetch/file.c b/lib/libfetch/file.c
index 7b6462f..ab6b4b7 100644
--- a/lib/libfetch/file.c
+++ b/lib/libfetch/file.c
@@ -149,5 +149,6 @@ fetchListFile(struct url *u, const char *flags __unused)
fetch_add_entry(&ue, &size, &len, de->d_name, &us);
}
+ closedir(dir);
return (ue);
}
OpenPOWER on IntegriCloud