From 373f0c91bec0bb5b3beba44159649a3b6003ffcd Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Mon, 17 Jun 2019 19:47:17 +0200 Subject: SLUDGE: fix use-after-free in PeopleManager::killMostPeople --- engines/sludge/people.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sludge') diff --git a/engines/sludge/people.cpp b/engines/sludge/people.cpp index 2d293194da..6cc0ddbe33 100644 --- a/engines/sludge/people.cpp +++ b/engines/sludge/people.cpp @@ -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) -- cgit v1.2.3