aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/cpp_api/s_security.cpp3
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;
}