Core: Fix potential UAF when loading a ROM in a VDir

This commit is contained in:
Vicki Pfau 2023-09-14 22:31:38 -07:00
parent 8520ad8f1f
commit 4de9d5f16c
1 changed files with 1 additions and 0 deletions

View File

@ -127,6 +127,7 @@ struct mCore* mCoreFind(const char* path) {
} }
bool mCoreLoadFile(struct mCore* core, const char* path) { bool mCoreLoadFile(struct mCore* core, const char* path) {
core->unloadROM(core);
#ifdef FIXED_ROM_BUFFER #ifdef FIXED_ROM_BUFFER
return mCorePreloadFile(core, path); return mCorePreloadFile(core, path);
#else #else