Bug 16574

Summary: Memory leak in _nss_dns_gethostbyname4_r with big DNS answer
Product: glibc Reporter: Andreas Schwab <schwab>
Component: networkAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: fweimer, rob.krakora
Priority: P2 Flags: fweimer: security+
Version: 2.11   
Target Milestone: 2.20   
Host: Target:
Build: Last reconfirmed:

Description Andreas Schwab 2014-02-13 11:51:20 UTC
When resolving both IPv4 and IPv6 and the answers from the DNS server are too big to fit together in the supplied buffer then a new buffer for the second answer is allocated by send_vc / send_dg, but _nss_dns_gethostbyname4_r fails to deallocate it.  This is the only place where the resolver functions are called in such a way that they may work with two buffers.
Comment 1 Andreas Schwab 2014-02-13 12:38:16 UTC
http://permalink.gmane.org/gmane.comp.lib.glibc.alpha/39632

Fixed by d668061.
Comment 2 Andreas Schwab 2014-02-19 10:53:06 UTC
The patch was wrong.
Comment 3 Andreas Schwab 2014-02-19 13:40:39 UTC
Properly fixed by ab09bf6.
Comment 4 Florian Weimer 2017-04-04 18:26:59 UTC
*** Bug 21336 has been marked as a duplicate of this bug. ***