This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/21885] New: getaddrinfo: gethosts does not release resolver context on memory allocation failure
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 02 Aug 2017 14:59:43 +0000
- Subject: [Bug network/21885] New: getaddrinfo: gethosts does not release resolver context on memory allocation failure
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=21885
Bug ID: 21885
Summary: getaddrinfo: gethosts does not release resolver
context on memory allocation failure
Product: glibc
Version: 2.26
Status: NEW
Severity: normal
Priority: P2
Component: network
Assignee: unassigned at sourceware dot org
Reporter: fweimer at redhat dot com
Target Milestone: ---
Flags: security-
This is a pre-existing bug but arguably made worse by the resolver context
extension:
if (!scratch_buffer_grow (tmpbuf)) \
{ \
result = -EAI_MEMORY; \
goto free_and_return; \
} \
vs
if (herrno == NETDB_INTERNAL) \
{ \
__set_h_errno (herrno); \
__resolv_context_enable_inet6 (res_ctx, res_enable_inet6); \
__resolv_context_put (res_ctx); \
result = -EAI_SYSTEM; \
goto free_and_return; \
} \
The first error return path needs to call __resolv_context_* functions as well.
--
You are receiving this mail because:
You are on the CC list for the bug.