X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=config_file%2Fconfig_file.c;h=12ba4b4e99955384a09dc5f833f954bc1ec14c63;hb=19ef9bfe6055b8ab06b8fc890dfbb46fd8ebe892;hp=d60b9b7844a0b4f681c895a3aed176012a34fe09;hpb=eac4c78c3e1b9c1bef48b736c79a083edd884707;p=pistorm diff --git a/config_file/config_file.c b/config_file/config_file.c index d60b9b7..12ba4b4 100644 --- a/config_file/config_file.c +++ b/config_file/config_file.c @@ -306,7 +306,9 @@ void free_config_file(struct emulator_config *cfg) { for (int i = 0; i < MAX_NUM_MAPPED_ITEMS; i++) { if (cfg->map_data[i]) { - free(cfg->map_data[i]); + if (cfg->map_type[i] != MAPTYPE_RAM_NOALLOC) { + free(cfg->map_data[i]); + } cfg->map_data[i] = NULL; } if (cfg->map_id[i]) { @@ -314,6 +316,7 @@ void free_config_file(struct emulator_config *cfg) { cfg->map_id[i] = NULL; } } + if (cfg->mouse_file) { free(cfg->mouse_file); cfg->mouse_file = NULL;