Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Andreas Schwab committed Mar 15, 2016
1 parent 2beb101 commit 5e7fdab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,3 +1,9 @@
2016-03-15 Andreas Schwab <schwab@suse.de>

[BZ #19257]
* resolv/res_init.c (__res_iclose): Use statp->nscount instead of
statp->_u._ext.nscount as loop count.

2016-03-14 Andreas Schwab <schwab@linux-m68k.org>

* math/test-signgam-finite-c99.c: Also #undef
Expand Down
2 changes: 1 addition & 1 deletion resolv/res_init.c
Expand Up @@ -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]);
Expand Down

0 comments on commit 5e7fdab

Please sign in to comment.