glibc/glibc-rh168253-getaddrinfo-gethosts-res-ctx-release.patch
Florian Weimer 8597553f96 Rebase DNS stub resolver to the glibc 2.26 version
- Support an arbitrary number of search domains (#168253)
- Detect and apply /etc/resolv.conf changes in libresolv (#1374239)
- CVE-2015-5180: DNS stub resolver crash with crafted record type (#1251403)
2017-10-11 14:41:27 +02:00

22 lines
875 B
Diff

commit dc258ce62ae0bbb456c6a855dbb6b384ecf7e988
Author: Florian Weimer <fweimer@redhat.com>
Date: Thu Aug 3 13:59:17 2017 +0200
getaddrinfo: Release resolver context on error in gethosts [BZ #21885]
(cherry picked from commit 964263bb8d650f1681665c55704fb01a8e725621)
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index efa7118498990073..699411cc92fc210c 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -255,6 +255,8 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
break; \
if (!scratch_buffer_grow (tmpbuf)) \
{ \
+ __resolv_context_enable_inet6 (res_ctx, res_enable_inet6); \
+ __resolv_context_put (res_ctx); \
result = -EAI_MEMORY; \
goto free_and_return; \
} \