This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix memory leak in __res_vinit/__res_iclose
- From: Aurelien Jarno <aurelien at aurel32 dot net>
- To: libc-alpha at sourceware dot org
- Date: Mon, 14 Mar 2016 20:08:50 +0100
- Subject: Re: [PATCH] Fix memory leak in __res_vinit/__res_iclose
- Authentication-results: sourceware.org; auth=none
- References: <1457982089-16937-1-git-send-email-aurelien at aurel32 dot net>
On 2016-03-14 20:01, Aurelien Jarno wrote:
> When resolv.conf contains IPv6 nameservers, __res_vinit stores their
> address in malloced areas, pointed by statp->_u._ext.nsaddrs. They are
> supposed to be freed later by __res_iclose, but it doesn't work as the
> loop is done on statp->_u._ext.nscount instead of statp->nscount. This
> causes a memory leak. This patch fixes it.
>
> Changelog:
> [BZ #19527]
> * resolv/res_init.c (__res_iclose): Loop on statp->nscount instead of
> statp->_u._ext.nscount.
> ---
> ChangeLog | 6 ++++++
> resolv/res_init.c | 2 +-
> 2 files changed, 7 insertions(+), 1 deletion(-)
I have just been pointed by Florian Weimer that Andreas Weimer already
posted a patch. Sorry about that, I missed it.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net