summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp6
1 files changed, 4 insertions, 2 deletions
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");