diff options
author | Andreas Schwab <schwab@suse.de> | 2015-11-18 15:45:59 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2016-03-15 13:15:54 +0100 |
commit | 5e7fdabd7df1fc6c56d104e61390bf5a6b526c38 (patch) | |
tree | 52f60a63da56882c9041729447fed2d1b1e3d8c5 /resolv | |
parent | 2beb1010e4cc7083f8e253db8af615476c9959fd (diff) | |
download | glibc-5e7fdabd7df1fc6c56d104e61390bf5a6b526c38.zip glibc-5e7fdabd7df1fc6c56d104e61390bf5a6b526c38.tar.gz glibc-5e7fdabd7df1fc6c56d104e61390bf5a6b526c38.tar.bz2 |
Fix resource leak in resolver (bug 19257)
The number of currently defined nameservers is stored in ->nscount,
whereas ->_u._ext.nscount is set by __libc_res_nsend only after local
initializations.
Diffstat (limited to 'resolv')
-rw-r--r-- | resolv/res_init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/resolv/res_init.c b/resolv/res_init.c index 128004a..02590fb 100644 --- a/resolv/res_init.c +++ b/resolv/res_init.c @@ -580,7 +580,7 @@ __res_iclose(res_state statp, bool free_addr) { statp->_vcsock = -1; statp->_flags &= ~(RES_F_VC | RES_F_CONN); } - for (ns = 0; ns < statp->_u._ext.nscount; ns++) + for (ns = 0; ns < statp->nscount; ns++) if (statp->_u._ext.nsaddrs[ns]) { if (statp->_u._ext.nssocks[ns] != -1) { close_not_cancel_no_status(statp->_u._ext.nssocks[ns]); |