1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 01:53:13 +02:00

Fix use after free from unloading modules which are the last one holding onto an IdentifyRequest

This commit is contained in:
Adam
2015-07-31 17:07:30 -04:00
parent 4e8cc4f786
commit e65a22ae9d
+14 -2
View File
@@ -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;
}
}
}