fix: memory leak
This commit is contained in:
@@ -56,6 +56,8 @@ void free__script(char **buf) {
|
|||||||
for (size_t i = 0; i < line_count; ++i)
|
for (size_t i = 0; i < line_count; ++i)
|
||||||
if (buf[i])
|
if (buf[i])
|
||||||
free_(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);
|
free_(buf);
|
||||||
|
#endif
|
||||||
free__state();
|
free__state();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,6 +205,6 @@ int pasm_run_script(const char *filename, char **file, size_t lines, int _fstrea
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ret_code = get_exit_state();
|
int ret_code = get_exit_state();
|
||||||
//free__script(file);
|
free__script(file);
|
||||||
return ret_code;
|
return ret_code;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user