Put the clear BEFORE the return

This commit is contained in:
2023-01-27 05:56:23 +00:00
parent 708db75760
commit 50b07da188

View File

@@ -626,7 +626,7 @@ Toy_Literal Toy_getFilePathLiteral(Toy_Interpreter* interpreter, Toy_Literal* dr
Toy_deleteRefString(path); Toy_deleteRefString(path);
Toy_deleteRefString(drivePath); Toy_deleteRefString(drivePath);
return TOY_TO_STRING_LITERAL(Toy_createRefStringLength(filePath, realLength));
TOY_FREE_ARRAY(char, filePath, realLength + 1); TOY_FREE_ARRAY(char, filePath, realLength + 1);
return TOY_TO_STRING_LITERAL(Toy_createRefStringLength(filePath, realLength));
} }