Fixed a memory leak

This commit is contained in:
2026-05-08 17:23:36 +10:00
parent 6c055a0435
commit 8b9b012bcc
+4
View File
@@ -384,6 +384,8 @@ static void processInvoke(Toy_VM* vm) {
Toy_String* name = Toy_toStringLength(&subVM.memoryBucket, cstr, strlen(cstr)); Toy_String* name = Toy_toStringLength(&subVM.memoryBucket, cstr, strlen(cstr));
Toy_declareScope(subVM.scope, name, paramType, argValue, true); Toy_declareScope(subVM.scope, name, paramType, argValue, true);
Toy_freeString(name);
} }
//run //run
@@ -417,6 +419,8 @@ static void processInvoke(Toy_VM* vm) {
Toy_error("Can't call an unknown function type"); Toy_error("Can't call an unknown function type");
break; break;
} }
Toy_freeValue(value);
} }
static void processAttribute(Toy_VM* vm) { static void processAttribute(Toy_VM* vm) {