mostly fixed sanitization issue

This commit is contained in:
Add00
2023-08-14 23:09:13 -04:00
parent 79f2e231db
commit 1603ea1798
2 changed files with 5 additions and 1 deletions

View File

@@ -486,6 +486,7 @@ static int nativeSeek(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments)
Toy_pushLiteralArray(&interpreter->stack, resultLiteral); Toy_pushLiteralArray(&interpreter->stack, resultLiteral);
// cleanup // cleanup
Toy_deleteRefString(orginString);
Toy_freeLiteral(resultLiteral); Toy_freeLiteral(resultLiteral);
Toy_freeLiteral(offsetLiteral); Toy_freeLiteral(offsetLiteral);
Toy_freeLiteral(selfLiteral); Toy_freeLiteral(selfLiteral);

View File

@@ -42,7 +42,6 @@ fn reset() {
writer.close(); writer.close();
} }
// test open and close // test open and close
{ {
var reader = open(PATH, "r"); var reader = open(PATH, "r");
@@ -145,4 +144,8 @@ fn reset() {
reader.close(); reader.close();
} }
// standard in/out are closed to prevent memory leaks
input.close();
output.close();
print "All good"; print "All good";