Fix memory leak in ::safeLoadFile (#4730)
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