mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Fix memory leak in ::safeLoadFile (#4730)
This commit is contained in:
@@ -323,9 +323,12 @@ bool ScriptApiSecurity::safeLoadFile(lua_State *L, const char *path)
|
||||
}
|
||||
|
||||
if (luaL_loadbuffer(L, code, size, chunk_name)) {
|
||||
delete [] code;
|
||||
return false;
|
||||
}
|
||||
|
||||
delete [] code;
|
||||
|
||||
if (path) {
|
||||
delete [] chunk_name;
|
||||
}
|
||||
|
Reference in New Issue
Block a user