mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
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)) {
|
if (luaL_loadbuffer(L, code, size, chunk_name)) {
|
||||||
|
delete [] code;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete [] code;
|
||||||
|
|
||||||
if (path) {
|
if (path) {
|
||||||
delete [] chunk_name;
|
delete [] chunk_name;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user