git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 39c71b40e7e6afe07df77fe21a4fc63281e861d9
parent 328e2d9e40730021bf4cfa52565047d3716b99e4
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Fri,  2 Apr 2021 19:07:28 +0300

Fix memory leak

Diffstat:
MCore/mbc.c5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/Core/mbc.c b/Core/mbc.c @@ -125,6 +125,11 @@ void GB_configure_cart(GB_gameboy_t *gb) else if (gb->rom[0x147] != 0 && memcmp(gb->cartridge_type, &GB_cart_defs[0], sizeof(GB_cart_defs[0])) == 0) { GB_log(gb, "Cartridge type %02x is not yet supported.\n", gb->rom[0x147]); } + + if (gb->mbc_ram) { + free(gb->mbc_ram); + gb->mbc_ram = NULL; + } if (gb->cartridge_type->has_ram) { if (gb->cartridge_type->mbc_type == GB_MBC2) {

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.