aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge
diff options
context:
space:
mode:
authorSebastian Krzyszkowiak2019-06-17 19:47:17 +0200
committerFilippos Karapetis2019-06-17 22:11:14 +0300
commit373f0c91bec0bb5b3beba44159649a3b6003ffcd (patch)
tree7bbc27dba6dd00d2fb7b131ce98901e6f897d020 /engines/sludge
parentb503401c45aaa4783d2087ed26caec57777cdec1 (diff)
downloadscummvm-rg350-373f0c91bec0bb5b3beba44159649a3b6003ffcd.tar.gz
scummvm-rg350-373f0c91bec0bb5b3beba44159649a3b6003ffcd.tar.bz2
scummvm-rg350-373f0c91bec0bb5b3beba44159649a3b6003ffcd.zip
SLUDGE: fix use-after-free in PeopleManager::killMostPeople
Diffstat (limited to 'engines/sludge')
-rw-r--r--engines/sludge/people.cpp2
1 files changed, 1 insertions, 1 deletions
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)