From 382877639d331dca6a03637527c5dd9eb3e74cec Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Tue, 23 Jan 2024 09:10:04 +0100 Subject: [PATCH] fix: memory leak --- src/pasm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pasm.c b/src/pasm.c index f653b8f..a793453 100644 --- a/src/pasm.c +++ b/src/pasm.c @@ -112,8 +112,10 @@ int pasm_run_script(const char *filename, char **file, size_t lines, int _fstrea const command_t *com = find_command(command_map, strtok(line, " ")); if (com == NULL || com->fptr == NULL) { ARRAY_ERR err = add_array(file[state->curr_line]); - if (err == ARRAY_OK) - continue; + if (err == ARRAY_OK) { + free(line); + continue; + } if (err == ARRAY_ERROR) { show_error(state->curr_line, file[state->curr_line]); dprintf(fstream, "%s\n", "bad syntax in array definition");