summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-13 03:48:39 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-13 03:48:39 +0000
commit9517adab7481acbd258dcba4b235c633760749b2 (patch)
tree347932d7974bfd7f9f8a1469133e5bc9df2513a8 /src/modules
parent3e5f0a9f023330b4da7db667e8649df964d920cf (diff)
Fixed m_park stuff
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1068 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_park.cpp9
1 files changed, 6 insertions, 3 deletions
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;
}