From eb74aa93eb2085416958c76b2b03ab71ca8931d0 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 2 Dec 2005 10:05:06 +0000 Subject: Attempted fix for om bug git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2110 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index bc375bf23..31621d980 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -506,6 +506,7 @@ class TreeSocket : public InspSocket strcpy(mode_users[1],"+"); unsigned int modectr = 2; + userrec* who = NULL; std::string channel = params[0]; char* key = ""; chanrec* chan = Srv->FindChannel(channel); @@ -537,7 +538,7 @@ class TreeSocket : public InspSocket strlcat(modestring,"v",MAXBUF); break; } - userrec* who = Srv->FindNick(usr); + who = Srv->FindNick(usr); if (who) { Srv->JoinUserToChannel(who,channel,key); @@ -553,12 +554,9 @@ class TreeSocket : public InspSocket } // there werent enough modes built up to flush it during FJOIN, // or, there are a number left over. flush them out. - if (modectr > 2) + if ((modectr > 2) && (who)) { - userrec* who = new userrec; - who->fd = FD_MAGIC_NUMBER; Srv->SendMode(mode_users,modectr,who); - delete who; } DoOneToAllButSender(source,"FJOIN",params,source); return true; -- cgit v1.2.3