Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix memory leak in ::safeLoadFile (#4730)
  • Loading branch information
Zeno- committed Nov 5, 2016
1 parent 6bb4347 commit b5c84c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/script/cpp_api/s_security.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit b5c84c3

Please sign in to comment.