diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-07-21 18:30:11 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-07-21 18:30:11 +0000 |
commit | 2ed2dc184687ed609f7223bb5e9b30712742e876 (patch) | |
tree | 02e751efa30036e368c34d32c4c81c670afbb3c2 /resolv/res_libc.c | |
parent | 84b5ba7ecf85e45792d1571c2b29a8f2dbf1c989 (diff) | |
download | glibc-2ed2dc184687ed609f7223bb5e9b30712742e876.zip glibc-2ed2dc184687ed609f7223bb5e9b30712742e876.tar.gz glibc-2ed2dc184687ed609f7223bb5e9b30712742e876.tar.bz2 |
Update.
2004-07-21 Jakub Jelinek <jakub@redhat.com>
* resolv/res_libc.c (res_init): If RES_INIT is set and
_res.nscount > 0, call __res_nclose and free nsaddrs.
* resolv/Makefile: Add rules to build and run tst-leaks2.
* resolv/tst-leaks2.c: New test.
Diffstat (limited to 'resolv/res_libc.c')
-rw-r--r-- | resolv/res_libc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/resolv/res_libc.c b/resolv/res_libc.c index 66da110..94bb2fd 100644 --- a/resolv/res_libc.c +++ b/resolv/res_libc.c @@ -54,6 +54,14 @@ res_init(void) { _res.retry = 4; if (!(_res.options & RES_INIT)) _res.options = RES_DEFAULT; + else if (_res.nscount > 0) { + __res_nclose (&_res); /* Close any VC sockets. */ + + for (int ns = 0; ns < MAXNS; ns++) { + free (_res._u._ext.nsaddrs[ns]); + _res._u._ext.nsaddrs[ns] = NULL; + } + } /* * This one used to initialize implicitly to zero, so unless the app |