mirror of https://github.com/mgba-emu/mgba.git
DS: Fix freeing memory for partial BIOS on load failure
This commit is contained in:
parent
1c0aa6c358
commit
92c1087adf
1
CHANGES
1
CHANGES
|
@ -16,6 +16,7 @@ Bugfixes:
|
|||
- GBA Video: Fix regression adjusting brightness of backdrop
|
||||
- DS GX: Properly reject invalid commands
|
||||
- DS: Fix leaking BIOS and firmware filehandles
|
||||
- DS: Fix freeing memory for partial BIOS on load failure
|
||||
Misc:
|
||||
- DS GX: Clean up and unify texture mapping
|
||||
- DS Core: Add symbol loading
|
||||
|
|
|
@ -597,7 +597,11 @@ bool DSLoadBIOS(struct DS* ds, struct VFile* vf) {
|
|||
mLOG(DS, INFO, "Official DS ARM9 BIOS detected");
|
||||
} else {
|
||||
mLOG(DS, WARN, "BIOS checksum incorrect");
|
||||
vf->unmap(vf, data, size);
|
||||
if (size == 0x1000) {
|
||||
free(data);
|
||||
} else {
|
||||
vf->unmap(vf, data, size);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue