From 269d6af510b641c4d848ada8e20325205aa2e7be Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 14 Feb 2024 08:38:00 +0100 Subject: Free alloced buffer for DB instructions --- src/c8asm/main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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); -- cgit v1.2.3