summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoradam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-07-16 03:51:00 +0000
committeradam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-07-16 03:51:00 +0000
commit17a09abb6df727e73126a7d001f5e68c5246ba39 (patch)
treea4e0cce9772ed32a6ac68dde4526d6709ed2ce36 /src
parent57e66618e76e224dd3586fb0fd87158240714262 (diff)
Fixed crashes when an unidentified users nickcore gets deleted
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2380 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/nickserv.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nickserv.c b/src/nickserv.c
index 0c9042cc1..f09cdb9fd 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -1106,6 +1106,24 @@ void change_core_display(NickCore * nc)
static int delcore(NickCore * nc)
{
int i;
+ User *user;
+
+ /* Clean up this nick core from any users online using it
+ * (ones that /nick but remain unidentified)
+ */
+ for (i = 0; i < 1024; ++i)
+ {
+ for (user = userlist[i]; user; user = user->next)
+ {
+ if (user->nc && user->nc == nc)
+ {
+ ircdproto->SendAccountLogout(user, user->nc);
+ user->nc = NULL;
+ FOREACH_MOD(I_OnNickLogout, OnNickLogout(user));
+ }
+ }
+ }
+
/* (Hopefully complete) cleanup */
cs_remove_nick(nc);