This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: getaddrinfo_a memory leaks
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Martin Sustrik <sustrik at 250bpm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 31 May 2013 10:49:34 +0200
- Subject: Re: getaddrinfo_a memory leaks
- References: <553a4173be770c28b60240fb6fc3ad45 at webmail dot moloch dot sk>
On Fri, May 31, 2013 at 10:27:51AM +0200, Martin Sustrik wrote:
> Hi all,
>
> Just a quick question: Is getaddrinfo_a supposed to leak memory?
>
It should not.
> When run with valgrind following leaks are reported:
>
> ==1959== 3,200 bytes in 50 blocks are definitely lost in loss record
> 3 of 4
> ==1959== at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
> ==1959== by 0x573D00E: gaih_inet (getaddrinfo.c:1001)
Code at line 1001 is following which is out of sync with info above.
malloc_canonbuf = true;
}
char *s;
if (DL_CALL_FCT (cfct, (at->name ?: name,
canonbuf,
max_fqdn_len,
&s, &rc, &herrno))
== NSS_STATUS_SUCCESS)
> ==1959== by 0x57406B1: getaddrinfo (getaddrinfo.c:2161)
> ==1959== by 0x5262ED8: handle_requests (gai_misc.c:321)
> ==1959== by 0x546CD8B: start_thread (pthread_create.c:304)
> ==1959== by 0x576A04C: clone (clone.S:112)
> ==1959==
> ==1959== 5,200 bytes in 50 blocks are possibly lost in loss record 4
> of 4
> ==1959== at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
> ==1959== by 0x5263C08: getaddrinfo_a (getaddrinfo_a.c:150)
> ==1959== my application stack follows here
>
> Thanks!
> Martin