mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-05-02 02:23:56 +00:00
Fix use-after-free in LegoCharacterManager::ReleaseActor (#214)
Null out the actor's ROI pointer before deletion to prevent its destructor from dereferencing the already-freed ROI.
This commit is contained in:
parent
b3e73aa675
commit
bb5daa17d2
@ -358,6 +358,7 @@ void LegoCharacterManager::ReleaseActor(const char* p_name)
|
||||
|
||||
if (info != NULL) {
|
||||
if (info->m_actor != NULL) {
|
||||
info->m_actor->SetROI(NULL, FALSE, FALSE);
|
||||
info->m_actor->ClearFlag(LegoEntity::c_managerOwned);
|
||||
delete info->m_actor;
|
||||
}
|
||||
@ -400,6 +401,7 @@ void LegoCharacterManager::ReleaseActor(LegoROI* p_roi)
|
||||
|
||||
if (info != NULL) {
|
||||
if (info->m_actor != NULL) {
|
||||
info->m_actor->SetROI(NULL, FALSE, FALSE);
|
||||
info->m_actor->ClearFlag(LegoEntity::c_managerOwned);
|
||||
delete info->m_actor;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user