mirror of
https://github.com/anope/anope.git
synced 2026-07-03 13:03:14 +02:00
Fix use after free from unloading modules which are the last one holding onto an IdentifyRequest
This commit is contained in:
+14
-2
@@ -73,8 +73,20 @@ void IdentifyRequest::ModuleUnload(Module *m)
|
||||
IdentifyRequest *ir = *it;
|
||||
++it;
|
||||
|
||||
ir->Release(m);
|
||||
if (ir->owner == m)
|
||||
ir->holds.erase(m);
|
||||
if (ir->holds.empty() && ir->dispatched)
|
||||
{
|
||||
if (!ir->success)
|
||||
ir->OnFail();
|
||||
delete ir;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ir->owner == m)
|
||||
{
|
||||
if (!ir->success)
|
||||
ir->OnFail();
|
||||
delete ir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user