projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6bb4347
)
Fix memory leak in ::safeLoadFile (#4730)
author
Zeno-
<kde.psych@gmail.com>
Sat, 5 Nov 2016 05:10:49 +0000
(15:10 +1000)
committer
GitHub
<noreply@github.com>
Sat, 5 Nov 2016 05:10:49 +0000
(15:10 +1000)
src/script/cpp_api/s_security.cpp
patch
|
blob
|
history
diff --git
a/src/script/cpp_api/s_security.cpp
b/src/script/cpp_api/s_security.cpp
index 0e64c4c61e3720c82ea2c5e51da7d549de5b8523..3a8f724fe0024a77f06e5d2dd3c63847d8123793 100644
(file)
--- 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)) {
}
if (luaL_loadbuffer(L, code, size, chunk_name)) {
+ delete [] code;
return false;
}
return false;
}
+ delete [] code;
+
if (path) {
delete [] chunk_name;
}
if (path) {
delete [] chunk_name;
}