fixed GC bug

This commit is contained in:
2020-11-17 03:10:55 -06:00
parent 204bec3d0a
commit 1329b72fcd
5 changed files with 56 additions and 9 deletions

View File

@@ -39,7 +39,7 @@ void cosmoO_free(CState *state, CObj* obj) {
switch(obj->type) {
case COBJ_STRING: {
CObjString *objStr = (CObjString*)obj;
cosmoM_freearray(state, char, objStr->str, objStr->length);
cosmoM_freearray(state, char, objStr->str, objStr->length + 1);
cosmoM_free(state, CObjString, objStr);
break;
}