forked from Mirrorlandia_minetest/minetest
Fix memory leak in ::safeLoadFile (#4730)
This commit is contained in:
parent
6bb4347208
commit
b5c84c34ce
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user