mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 07:12:40 +02:00
Merge pull request #10992 from Atlante45/fix/heap-use-after-free
Fix potential data corruption in the FileCache
This commit is contained in:
commit
d76039387a
2 changed files with 3 additions and 2 deletions
|
@ -258,7 +258,8 @@ namespace cache {
|
|||
};
|
||||
}
|
||||
|
||||
void FileCache::eject(const FilePointer& file) {
|
||||
// Take file pointer by value to insure it doesn't get destructed during the "erase()" calls
|
||||
void FileCache::eject(FilePointer file) {
|
||||
file->_locked = false;
|
||||
const auto& length = file->getLength();
|
||||
const auto& key = file->getKey();
|
||||
|
|
|
@ -119,7 +119,7 @@ private:
|
|||
void clean();
|
||||
void clear();
|
||||
// Remove a file from the cache
|
||||
void eject(const FilePointer& file);
|
||||
void eject(FilePointer file);
|
||||
|
||||
size_t getOverbudgetAmount() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue