Skip to content

Commit 3d7c2fe

Browse files
authored
Fix use-after-free in creature conditions (#4726)
1 parent e9b6383 commit 3d7c2fe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/creature.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Creature::~Creature()
3333

3434
for (Condition* condition : conditions) {
3535
condition->endCondition(this);
36+
}
37+
38+
for (auto condition : conditions) {
3639
delete condition;
3740
}
3841
}

0 commit comments

Comments
 (0)