mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix memory leak in ::safeLoadFile (#4730)
This commit is contained in:
parent
6bb4347208
commit
b5c84c34ce
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue