diff options
author | Amaury Pouly <pamaury@rockbox.org> | 2011-11-06 19:41:29 +0000 |
---|---|---|
committer | Amaury Pouly <pamaury@rockbox.org> | 2011-11-06 19:41:29 +0000 |
commit | cd832bd0f5d19b066dc859df9355243de9a95424 (patch) | |
tree | 617e9f6e6fe2101fb5061a8450fb312232653779 /utils/imxtools | |
parent | ad9e2802811da0b6540ae40348b806601d430f45 (diff) |
imxtools: add function to free instruction
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30919 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/imxtools')
-rw-r--r-- | utils/imxtools/sb.c | 11 | ||||
-rw-r--r-- | utils/imxtools/sb.h | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/utils/imxtools/sb.c b/utils/imxtools/sb.c index 44db56b7d1..23b89e52c8 100644 --- a/utils/imxtools/sb.c +++ b/utils/imxtools/sb.c @@ -1039,13 +1039,16 @@ struct sb_file_t *sb_read_file(const char *filename, bool raw_mode, void *u, #undef print_hex } +void sb_free_instruction(struct sb_inst_t inst) +{ + free(inst.padding); + free(inst.data); +} + void sb_free_section(struct sb_section_t sec) { for(int j = 0; j < sec.nr_insts; j++) - { - free(sec.insts[j].padding); - free(sec.insts[j].data); - } + sb_free_instruction(sec.insts[j]); free(sec.insts); } diff --git a/utils/imxtools/sb.h b/utils/imxtools/sb.h index ced6481a80..e0f25b68a4 100644 --- a/utils/imxtools/sb.h +++ b/utils/imxtools/sb.h @@ -231,6 +231,7 @@ struct sb_file_t *sb_read_file(const char *filename, bool raw_mode, void *u, void sb_fill_section_name(char name[5], uint32_t identifier); void sb_dump(struct sb_file_t *file, void *u, sb_color_printf printf); +void sb_free_instruction(struct sb_inst_t inst); void sb_free_section(struct sb_section_t file); void sb_free(struct sb_file_t *file); |