mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
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.
This commit is contained in:
@ -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]);
|
||||
|
Reference in New Issue
Block a user