getaddrinfo: Release resolver context on error in gethosts [BZ #21885]

This commit is contained in:
Florian Weimer 2017-08-03 12:33:00 +02:00
parent 1f22702ea2
commit 964263bb8d
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-08-03 Florian Weimer <fweimer@redhat.com>
[BZ #21885]
* sysdeps/posix/getaddrinfo.c (gethosts): Release resolver context
on memory allocation failure.
2017-08-03 Alan Modra <amodra@gmail.com> 2017-08-03 Alan Modra <amodra@gmail.com>
* sysdeps/powerpc/mod-tlsopt-powerpc.c: Extract from * sysdeps/powerpc/mod-tlsopt-powerpc.c: Extract from

View File

@ -255,6 +255,8 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
break; \ break; \
if (!scratch_buffer_grow (tmpbuf)) \ if (!scratch_buffer_grow (tmpbuf)) \
{ \ { \
__resolv_context_enable_inet6 (res_ctx, res_enable_inet6); \
__resolv_context_put (res_ctx); \
result = -EAI_MEMORY; \ result = -EAI_MEMORY; \
goto free_and_return; \ goto free_and_return; \
} \ } \