From 1f738f0ad4bda5dc824929d55819c7e10dd8a234 Mon Sep 17 00:00:00 2001 From: Adam- Date: Fri, 9 Apr 2010 18:51:05 +0000 Subject: Fixed a potential crash when a user does not pass connection checks (akill/session) git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2877 5417fbe8-f217-4b02-8779-1006273d7864 --- src/users.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/users.c b/src/users.c index 219ccadcd..c236efc3b 100644 --- a/src/users.c +++ b/src/users.c @@ -828,11 +828,11 @@ User *do_nick(const char *source, const char *nick, const char *username, const if (Config.LimitSessions && !is_ulined(server)) add_session(nick, host, ipbuf); - /* Only call I_OnUserConnect if the user still exists */ - if (finduser(nick)) - { - FOREACH_MOD(I_OnUserConnect, OnUserConnect(user)); - } + /* User is no longer connected, return */ + if (!finduser(nick)) + return NULL; + + FOREACH_MOD(I_OnUserConnect, OnUserConnect(user)); } else { /* An old user changing nicks. */ if (ircd->ts6) -- cgit