Skip to content

Commit

Permalink
Fix use-after-free in creature conditions (#4726)
Browse files Browse the repository at this point in the history
  • Loading branch information
diath committed Jun 4, 2024
1 parent e9b6383 commit 3d7c2fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Creature::~Creature()

for (Condition* condition : conditions) {
condition->endCondition(this);
}

for (auto condition : conditions) {
delete condition;
}
}
Expand Down

0 comments on commit 3d7c2fe

Please sign in to comment.