OnClientDisconnect() always needs a valid user

If a client disconnected before completing the authentication,
OnClientDisconnect() was called with m_pUser == NULL. This problem is new since
previously MODULECALL silently failed if it got a NULL.

Thanks to ex0a for repeatedly crashing his znc to figure this out. :-P

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-09-11 10:50:27 +02:00
parent 893a631aa5
commit ff35970318
+3 -1
View File
@@ -685,7 +685,9 @@ void CClient::Disconnected() {
DEBUG(GetSockName() << " == Disconnected()");
SetNetwork(NULL, true, false);
MODULECALL(OnClientDisconnect(), m_pUser, m_pNetwork, this, NOTHING);
if (m_pUser) {
MODULECALL(OnClientDisconnect(), m_pUser, m_pNetwork, this, NOTHING);
}
}
void CClient::ReachedMaxBuffer() {