comparison genesis.c @ 2248:f7e2e11f1214

Fix improper free of memory map array from rom_info
author Michael Pavone <pavone@retrodev.com>
date Thu, 24 Nov 2022 01:22:21 -0800
parents 0d1d5dccdd28
children 8b88d57d1218
comparison
equal deleted inserted replaced
2247:08a16de0e4cb 2248:f7e2e11f1214
1613 free_rom_info(&gen->header.info); 1613 free_rom_info(&gen->header.info);
1614 free(gen->lock_on); 1614 free(gen->lock_on);
1615 if (gen->save_type != SAVE_NONE && gen->mapper_type != MAPPER_SEGA_MED_V2) { 1615 if (gen->save_type != SAVE_NONE && gen->mapper_type != MAPPER_SEGA_MED_V2) {
1616 free(gen->save_storage); 1616 free(gen->save_storage);
1617 } 1617 }
1618 free(map);
1618 free(gen); 1619 free(gen);
1619 } 1620 }
1620 1621
1621 static void gamepad_down(system_header *system, uint8_t gamepad_num, uint8_t button) 1622 static void gamepad_down(system_header *system, uint8_t gamepad_num, uint8_t button)
1622 { 1623 {
2231 map[i].ptr_index += cd->memptr_start_index; 2232 map[i].ptr_index += cd->memptr_start_index;
2232 } 2233 }
2233 } 2234 }
2234 cd->base = 0x400000; 2235 cd->base = 0x400000;
2235 } 2236 }
2237 info.map = gen->header.info.map = NULL;
2236 2238
2237 m68k_options *opts = malloc(sizeof(m68k_options)); 2239 m68k_options *opts = malloc(sizeof(m68k_options));
2238 init_m68k_opts(opts, map, map_chunks, MCLKS_PER_68K, sync_components); 2240 init_m68k_opts(opts, map, map_chunks, MCLKS_PER_68K, sync_components);
2239 if (!strcmp(tern_find_ptr_default(model, "tas", "broken"), "broken")) { 2241 if (!strcmp(tern_find_ptr_default(model, "tas", "broken"), "broken")) {
2240 opts->gen.flags |= M68K_OPT_BROKEN_READ_MODIFY; 2242 opts->gen.flags |= M68K_OPT_BROKEN_READ_MODIFY;