mirror of https://github.com/mgba-emu/mgba.git
Core: Fix memory leak loading ELF files
This commit is contained in:
parent
4dcb28ea70
commit
1ad033d925
1
CHANGES
1
CHANGES
|
@ -9,6 +9,7 @@ Other fixes:
|
|||
- 3DS: Redo video sync to be more precise
|
||||
- 3DS: Fix crash with libctru 2.0 when exiting
|
||||
- Core: Fix reported ROM size when a fixed buffer size is used
|
||||
- Core: Fix memory leak loading ELF files
|
||||
- GBA: Disable more checks when loading GS save with checks disabled (fixes mgba.io/i/1851)
|
||||
- GBA Core: Fix memory leak when loading symbols
|
||||
- Qt: Add dummy English translation file (fixes mgba.io/i/1469)
|
||||
|
|
|
@ -376,9 +376,11 @@ bool mCoreLoadELF(struct mCore* core, struct ELF* elf) {
|
|||
if (block && bsize >= phdr->p_filesz && esize > phdr->p_offset && esize >= phdr->p_filesz + phdr->p_offset) {
|
||||
memcpy(block, &bytes[phdr->p_offset], phdr->p_filesz);
|
||||
} else {
|
||||
ELFProgramHeadersDeinit(&ph);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ELFProgramHeadersDeinit(&ph);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue