Skip to content

Commit

Permalink
Merge pull request #2406 from Wang-Yue/patch-12
Browse files Browse the repository at this point in the history
Fix memory leak of script in fs.c
  • Loading branch information
nesbox authored Dec 17, 2023
2 parents 0e7b143 + 26912e5 commit 2ecc6be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/studio/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ static lua_State* netLuaInit(u8* buffer, s32 size)
if(lua)
{
if(luaL_loadstring(lua, script) == LUA_OK && lua_pcall(lua, 0, LUA_MULTRET, 0) == LUA_OK)
{
free(script);
return lua;

}
else lua_close(lua);
}

Expand Down

0 comments on commit 2ecc6be

Please sign in to comment.