summaryrefslogtreecommitdiffhomepage
path: root/src/dump.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-11-15 11:47:08 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2013-11-15 11:47:08 +0900
commit13c2d65b028f9fdc5eb5a038d4060af12a2eb80d (patch)
treefd60bd7ab8ef223a8b89d911e2f418cab89da893 /src/dump.c
parent3286e632020e2b133b6a38b70e81573363ec5052 (diff)
downloadmruby-13c2d65b028f9fdc5eb5a038d4060af12a2eb80d.tar.gz
mruby-13c2d65b028f9fdc5eb5a038d4060af12a2eb80d.zip
should not free buffer that is still accessed
Diffstat (limited to 'src/dump.c')
-rw-r--r--src/dump.c3
1 files changed, 2 insertions, 1 deletions
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; i<irep->rlen; 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;
}