aboutsummaryrefslogtreecommitdiff
path: root/src/c8asm
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-02-14 08:38:00 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-02-14 08:38:00 +0100
commit269d6af510b641c4d848ada8e20325205aa2e7be (patch)
tree03dbad8f13800cedd328a13fd0a78a947b4cc3b6 /src/c8asm
parent422e1e63b332ec41599e49a03e43c342046c92f7 (diff)
Free alloced buffer for DB instructions
Diffstat (limited to 'src/c8asm')
-rw-r--r--src/c8asm/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/c8asm/main.c b/src/c8asm/main.c
index c70aed5..b77c469 100644
--- a/src/c8asm/main.c
+++ b/src/c8asm/main.c
@@ -100,6 +100,11 @@ asmfile(int fd, const char *fn)
baseptr = u8strfit(&sb)->p;
assemble(stdout, ast = parsefile(toks = lexfile(u8strtou8(sb))));
+ da_foreach (&ast, node) {
+ if (node->kind == D_INSTR && node->instr.kind == I_DB)
+ free(node->instr.buf);
+ }
+
free(toks.buf);
free(ast.buf);
u8strfree(sb);