diff --git a/repl/lib_compound.c b/repl/lib_compound.c index d7b54b4..0cf62a7 100644 --- a/repl/lib_compound.c +++ b/repl/lib_compound.c @@ -187,6 +187,9 @@ static int nativeForEach(Toy_Interpreter* interpreter, Toy_LiteralArray* argumen } } + Toy_freeLiteral(fnLiteral); + Toy_freeLiteral(selfLiteral); + return 0; } @@ -376,6 +379,9 @@ static int nativeMap(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments) Toy_freeLiteral(returnsLiteral); } + Toy_freeLiteral(fnLiteral); + Toy_freeLiteral(selfLiteral); + return 0; }