summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMikael Hermansson <mikael@hermansson.io>2024-08-09 03:33:51 +0200
committerMikael Hermansson <mikael@hermansson.io>2024-08-09 03:33:51 +0200
commit613600fa894243ec5c5f8b88a27a7b7616ddc25c (patch)
tree84f4cbc2822c8b6c316949bbe4889603f5dc9f51 /core
parent739019e4e4a6e4763e37adfd9883a1c85d5f6249 (diff)
downloadredot-engine-613600fa894243ec5c5f8b88a27a7b7616ddc25c.tar.gz
Fix use-after-free in `FileAccess::exists`
Diffstat (limited to 'core')
-rw-r--r--core/io/file_access_pack.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index 991b94db38..02bf0a6039 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -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]);
}