Mercurial > repos > blastem
diff m68k_core.c @ 1593:24508cb54f87
Fix a number of other memory errors (mostly leaks again) identified by valgrind
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 28 Jun 2018 09:27:05 -0700 |
parents | 31effaadf877 |
children | b7ecd0d6a77b eda8df5bc74c |
line wrap: on
line diff
--- a/m68k_core.c Fri Jun 22 23:10:27 2018 -0700 +++ b/m68k_core.c Thu Jun 28 09:27:05 2018 -0700 @@ -468,7 +468,11 @@ } } if (opts->num_movem == opts->movem_storage) { - opts->movem_storage *= 2; + if (!opts->movem_storage) { + opts->movem_storage = 4; + } else { + opts->movem_storage *= 2; + } opts->big_movem = realloc(opts->big_movem, sizeof(movem_fun) * opts->movem_storage); } if (!opts->extra_code.cur) { @@ -1205,6 +1209,7 @@ free(opts->gen.ram_inst_sizes[i]); } free(opts->gen.ram_inst_sizes); + free(opts->big_movem); free(opts); }