SLUDGE: fix use-after-free in PeopleManager::killMostPeople

This commit is contained in:
Sebastian Krzyszkowiak 2019-06-17 19:47:17 +02:00 committed by Filippos Karapetis
parent b503401c45
commit 373f0c91be

View File

@ -837,7 +837,7 @@ void PeopleManager::killMostPeople() {
for (OnScreenPersonList::iterator it = _allPeople->begin(); it != _allPeople->end(); ++it) {
if (!((*it)->extra & EXTRA_NOREMOVE)) {
OnScreenPerson *killPeople = (*it);
_allPeople->reverse_erase(it);
it = _allPeople->reverse_erase(it);
// Gone from the list... now free some memory
if (killPeople->continueAfterWalking)