Skip to content

Commit b5c84c3

Browse files
authoredNov 5, 2016
Fix memory leak in ::safeLoadFile (#4730)
1 parent 6bb4347 commit b5c84c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/script/cpp_api/s_security.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,12 @@ bool ScriptApiSecurity::safeLoadFile(lua_State *L, const char *path)
323323
}
324324

325325
if (luaL_loadbuffer(L, code, size, chunk_name)) {
326+
delete [] code;
326327
return false;
327328
}
328329

330+
delete [] code;
331+
329332
if (path) {
330333
delete [] chunk_name;
331334
}

0 commit comments

Comments
 (0)
Please sign in to comment.