[PATCH] Fix leak in gataddrinfo when /etc/nsswitch.conf is absent
Allan McRae
allan@archlinux.org
Tue Sep 10 04:34:00 GMT 2013
From: Vinitha Vijayan <jiji.vinitha@gmail.com>
---
Patch submitted to the bug tracker without follow-up. Siddhesh gave it an
OK on the bug tracker. I believe this is too small to require a contributor
agreement.
OK to apply?
2013-09-10 Vinitha Vijayan <jiji.vinitha@gmail.com>
[BZ #15048]
* sysdeps/posix/getaddrinfo.c (gaih_inet): Fix memory leak.
sysdeps/posix/getaddrinfo.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index c0ded84..c9a97d4 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -797,9 +797,12 @@ gaih_inet (const char *name, const struct gaih_service *service,
nip = __nss_hosts_database;
}
else
- no_more = __nss_database_lookup ("hosts", NULL,
- "dns [!UNAVAIL=return] files",
- &nip);
+ {
+ no_more = __nss_database_lookup ("hosts", NULL,
+ "dns [!UNAVAIL=return] files",
+ &__nss_hosts_database);
+ nip = __nss_hosts_database;
+ }
/* Initialize configurations. */
if (__glibc_unlikely (!_res_hconf.initialized))
--
1.8.4
More information about the Libc-alpha
mailing list