[Bug libc/462] Leak in libresolv
mike dot patnode at centrify dot com
sourceware-bugzilla@sourceware.org
Wed Jun 6 21:47:00 GMT 2007
------- Additional Comments From mike dot patnode at centrify dot com 2007-06-06 21:47 -------
Valgrind still sees a 56 byte leak in 2.3.4 for each pair of res_ninit & res_nquery:
#include <stdio.h>
#include <errno.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <sys/types.h>
#include <resolv.h>
#include <netdb.h>
int
main (int argc, char *argv[])
{
unsigned char buf[1024];
int count=100;
struct __res_state dnsstate;
while (count--)
{
memset(&dnsstate, 0, sizeof( struct __res_state));
res_ninit(&dnsstate);
res_nquery (&dnsstate,"_ldap._tcp.foo.bar", C_IN, T_SRV, buf, 1024);
res_nclose(&dnsstate);
}
return 0;
}
==13030== 5,600 bytes in 200 blocks are definitely lost in loss record 1 of 1
==13030== at 0x4904B7E: malloc (vg_replace_malloc.c:149)
==13030== by 0x30FE1090B5: __libc_res_nsend (in /lib64/libresolv-2.3.4.so)
==13030== by 0x30FE108200: __libc_res_nquery (in /lib64/libresolv-2.3.4.so)
==13030== by 0x30FE1083E0: __res_nquery (in /lib64/libresolv-2.3.4.so)
==13030== by 0x400652: main (in /home/mike/src/res)
==13030==
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://sourceware.org/bugzilla/show_bug.cgi?id=462
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the Glibc-bugs
mailing list