diff options
author | Zeno- <kde.psych@gmail.com> | 2016-11-05 15:10:49 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-05 15:10:49 +1000 |
commit | b5c84c34ce283a56317902d24067d9a0795a44c5 (patch) | |
tree | 5b21acd6cecf41d092e784b7a3db9fc522b069bc | |
parent | 6bb43472082d8003a6cd140c1221c81005fdd752 (diff) | |
download | minetest-b5c84c34ce283a56317902d24067d9a0795a44c5.tar.gz minetest-b5c84c34ce283a56317902d24067d9a0795a44c5.tar.bz2 minetest-b5c84c34ce283a56317902d24067d9a0795a44c5.zip |
Fix memory leak in ::safeLoadFile (#4730)
-rw-r--r-- | src/script/cpp_api/s_security.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp index 0e64c4c61..3a8f724fe 100644 --- a/src/script/cpp_api/s_security.cpp +++ b/src/script/cpp_api/s_security.cpp @@ -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; } |