From 9517adab7481acbd258dcba4b235c633760749b2 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 13 Apr 2005 03:48:39 +0000 Subject: Fixed m_park stuff git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1068 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_park.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp index 5f0ce13c1..e08327bd3 100644 --- a/src/modules/m_park.cpp +++ b/src/modules/m_park.cpp @@ -46,6 +46,7 @@ parkinfo pinfo; long ParkMaxTime; long ConcurrentParks; long ParkMaxMsgs; +parkedinfo pi; void handle_park(char **parameters, int pcnt, userrec *user) { @@ -65,8 +66,7 @@ void handle_park(char **parameters, int pcnt, userrec *user) } else { - awaylog* aw = new awaylog; - parkedinfo pi; + awaylog* aw; char msg[MAXBUF]; long key = abs(random() * 12345); snprintf(msg,MAXBUF,"You are now parked. To unpark use /UNPARK %s %d",user->nick,key); @@ -268,9 +268,12 @@ class ModulePark : public Module if (time(NULL) >= (j->parktime+ParkMaxTime)) { userrec* thisnick = Srv->FindNick(j->nick); + // THIS MUST COME BEFORE THE QuitUser - QuitUser can + // create a recursive call to OnUserQuit in this module + // and then corrupt the pointer! + pinfo.erase(j); if (thisnick) Srv->QuitUser(thisnick,"PARK timeout"); - pinfo.erase(j); go_again = true; break; } -- cgit v1.2.3