aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-10-13 11:12:49 +0100
committerMatthew Wild <mwild1@gmail.com>2009-10-13 11:12:49 +0100
commit396757941327fb937b8f05a3d7822e6ce65efa0c (patch)
tree43d4f4336e85589e85e67ae2c1a5f985986d3488
parent193278754c23997fcbf1c7010ec6ac8da72cce90 (diff)
downloadprosody-396757941327fb937b8f05a3d7822e6ce65efa0c.tar.gz
prosody-396757941327fb937b8f05a3d7822e6ce65efa0c.zip
net.dns: Remove sockets from socketset when closing them, fixes a leak
-rw-r--r--net/dns.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/dns.lua b/net/dns.lua
index e793c397..fe327ed2 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -558,8 +558,11 @@ function resolver:socket_wrapper_set (func) -- - - - - - - socket_wrapper_set
function resolver:closeall () -- - - - - - - - - - - - - - - - - - closeall
- for i,sock in ipairs (self.socket) do self.socket[i]:close () end
- self.socket = {}
+ for i,sock in ipairs (self.socket) do
+ self.socket[i] = nil;
+ self.socketset[sock] = nil;
+ sock:close();
+ end
end