From cd330c4bc5ae3e2e89a5c02a031ffd90292e94f1 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 28 Jul 2014 14:21:20 +0200 Subject: m_spanningtree Ensure that TreeSocket::Close() only runs once --- src/modules/m_spanningtree/treesocket2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 25cc751e4..7e26a325e 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -344,8 +344,10 @@ void TreeSocket::OnTimeout() void TreeSocket::Close() { - if (fd != -1) - ServerInstance->GlobalCulls.AddItem(this); + if (fd < 0) + return; + + ServerInstance->GlobalCulls.AddItem(this); this->BufferedSocket::Close(); SetError("Remote host closed connection"); -- cgit v1.2.3