Skip to content

Commit

Permalink
Merge pull request #95311 from mihe/file-access-use-after-free
Browse files Browse the repository at this point in the history
Fix use-after-free in `FileAccess::exists`
  • Loading branch information
akien-mga committed Aug 9, 2024
2 parents d7c8a9f + 613600f commit c73ac74
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/io/file_access_pack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ void PackedData::_free_packed_dirs(PackedDir *p_dir) {
}

PackedData::~PackedData() {
if (singleton == this) {
singleton = nullptr;
}

for (int i = 0; i < sources.size(); i++) {
memdelete(sources[i]);
}
Expand Down

0 comments on commit c73ac74

Please sign in to comment.