diff options
author | B. Watson <urchlay@slackware.uk> | 2024-06-18 01:50:21 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-06-18 01:50:21 -0400 |
commit | 600c7fcd2ca1827cb1e02d8821878410ae410638 (patch) | |
tree | f4d5685c91c0256dc7935406f4611defce016f63 | |
parent | e1ba78324eccdb4db798bf05d640d616ccecc217 (diff) | |
download | bw-atari8-tools-600c7fcd2ca1827cb1e02d8821878410ae410638.tar.gz |
cxrefbas and renumbas: free allocated memory on exit.
-rw-r--r-- | cxrefbas.c | 1 | ||||
-rw-r--r-- | linetab.c | 5 | ||||
-rw-r--r-- | linetab.h | 1 | ||||
-rw-r--r-- | renumbas.c | 1 |
4 files changed, 8 insertions, 0 deletions
@@ -67,6 +67,7 @@ int main(int argc, char **argv) { build_ref_table(); print_ref_table(); + free_ref_table(); return 0; } @@ -164,3 +164,8 @@ void build_ref_table(void) { on_start_stmt = on_cmd_token = on_exp_token = on_var_token = 0; } +void free_ref_table(void) { + int i; + for(i = 0; i < 32768; i++) + if(linerefs[i]) free(linerefs[i]); +} @@ -20,3 +20,4 @@ extern int lines_exist[]; extern void add_lineref(unsigned short from, unsigned short pos); extern void build_ref_table(void); +extern void free_ref_table(void); @@ -119,6 +119,7 @@ int main(int argc, char **argv) { build_ref_table(); renumber(); + free_ref_table(); open_output(output_filename); writefile(); |