From 7d075564787cbde9bf05aca8b1cd5b10ea978c05 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 13 Feb 2010 17:20:56 +0000 Subject: Fix double-invocation of Squit that can cause a crash on delink git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12451 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 4 ---- src/modules/m_spanningtree/treesocket1.cpp | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 3e5e2beb9..ee2118915 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -154,8 +154,6 @@ restart: if (s->GetSocket() && s->GetSocket()->GetLinkState() == DYING) { - s->GetSocket()->SendError("Ping timeout"); - s->GetSocket()->Squit(s,"Ping timeout"); s->GetSocket()->Close(); goto restart; } @@ -196,7 +194,6 @@ restart: if (sock) { sock->SendError("Ping timeout"); - sock->Squit(s,"Ping timeout"); sock->Close(); goto restart; } @@ -776,7 +773,6 @@ void ModuleSpanningTree::OnUnloadModule(Module* mod) if (sock && sock->GetIOHook() == mod) { sock->SendError("SSL module unloaded"); - sock->Squit(srv,"SSL module unloaded"); sock->Close(); } } diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 5efa58f3b..79da951b6 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -205,6 +205,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) Current->GetParent()->DelChild(Current); Current->cull(); delete Current; + Current = NULL; if (LocalSquit) ServerInstance->SNO->WriteToSnoMask('l', "Netsplit complete, lost \002%d\002 user%s on \002%d\002 server%s.", num_lost_users, num_lost_users != 1 ? "s" : "", num_lost_servers, num_lost_servers != 1 ? "s" : ""); else -- cgit v1.2.3