fix: memory leak

This commit is contained in:
2024-08-24 19:46:43 +02:00
parent 37c4a37287
commit fff046f860
2 changed files with 3 additions and 1 deletions

View File

@@ -56,6 +56,8 @@ void free__script(char **buf) {
for (size_t i = 0; i < line_count; ++i)
if (buf[i])
free_(buf[i]);
#ifndef LAIKA //crashes otherwise, idk if it's due to the script being passed as a char** or what
free_(buf);
#endif
free__state();
}

View File

@@ -205,6 +205,6 @@ int pasm_run_script(const char *filename, char **file, size_t lines, int _fstrea
}
int ret_code = get_exit_state();
//free__script(file);
free__script(file);
return ret_code;
}