mirror of https://github.com/mgba-emu/mgba.git
Core: Fix potential UAF when loading a ROM in a VDir
This commit is contained in:
parent
8520ad8f1f
commit
4de9d5f16c
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue