Fixed a leak

This commit is contained in:
2022-09-04 20:23:50 +10:00
parent cc27da50df
commit ac35a859e0
2 changed files with 51 additions and 3 deletions

View File

@@ -119,6 +119,7 @@ int _set(Interpreter* interpreter, LiteralArray* arguments) {
}
//don't use pushLiteralArray, since we're setting
freeLiteral(AS_ARRAY(obj)->literals[AS_INTEGER(key)]); //BUGFIX: clear any existing data first
AS_ARRAY(obj)->literals[AS_INTEGER(key)] = copyLiteral(val);
if (!setScopeVariable(interpreter->scope, idn, obj, true)) {