This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getaddrinfo_a memory leaks


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]