1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 08:26:38 +02:00

Fix previous commit, deleting sessions removes it from the map which invalidates the reference

This commit is contained in:
Adam
2016-12-21 10:35:57 -05:00
parent 4381031994
commit 574c8dfbc7
+6 -2
View File
@@ -150,7 +150,7 @@ class SASLService : public SASL::Service, public Timer
}
}
Session* &session = sessions[m.source];
Session* session = GetSession(m.source);
if (m.type == "S")
{
@@ -178,18 +178,22 @@ class SASLService : public SASL::Service, public Timer
{
session->hostname = hostname;
session->ip = ip;
sessions[m.source] = session;
}
}
else if (m.type == "D")
{
delete session;
sessions.erase(m.source);
return;
}
else if (m.type == "H")
{
if (!session)
{
session = new Session(NULL, m.source);
sessions[m.source] = session;
}
session->hostname = m.data;
session->ip = m.ext;
}