diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-06-28 09:27:05 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-06-28 09:27:05 -0700 |
commit | 5f1a3e5c10bd84d5049b1a8a56c5aace468761cb (patch) | |
tree | 324045c83ac9f6d1475be867ee7b0dba642290c9 /m68k_core.c | |
parent | e1d177b8429e4eb59f5a6e853009dbf97ab95068 (diff) |
Fix a number of other memory errors (mostly leaks again) identified by valgrind
Diffstat (limited to 'm68k_core.c')
-rw-r--r-- | m68k_core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/m68k_core.c b/m68k_core.c index a118b18..56013e7 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -468,7 +468,11 @@ static code_ptr get_movem_impl(m68k_options *opts, m68kinst *inst) } } 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 @@ void m68k_options_free(m68k_options *opts) free(opts->gen.ram_inst_sizes[i]); } free(opts->gen.ram_inst_sizes); + free(opts->big_movem); free(opts); } |