Fix memory leak in ::safeLoadFile (#4730)

This commit is contained in:
Zeno- 2016-11-05 15:10:49 +10:00 committed by GitHub
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;
}