From 13c2d65b028f9fdc5eb5a038d4060af12a2eb80d Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 15 Nov 2013 11:47:08 +0900 Subject: should not free buffer that is still accessed --- src/dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dump.c b/src/dump.c index eaee536d9..6ecc6085a 100644 --- a/src/dump.c +++ b/src/dump.c @@ -610,7 +610,6 @@ write_section_debug(mrb_state *mrb, mrb_irep *irep, uint8_t *cur) for (i=0; irlen; i++) { section_size += write_filename_table(mrb, irep->reps[i], &cur, &filenames, &filenames_len); } - mrb_free(mrb, filenames); uint16_to_bin(filenames_len, filenames_len_out); // debug records @@ -621,6 +620,8 @@ write_section_debug(mrb_state *mrb, mrb_irep *irep, uint8_t *cur) memcpy(header->section_identify, RITE_SECTION_DEBUG_IDENTIFIER, sizeof(header->section_identify)); uint32_to_bin(section_size, header->section_size); + mrb_free(mrb, filenames); + return MRB_DUMP_OK; } -- cgit v1.2.3