Permalink
Browse files

Script: Fix handle leak with unclosed script file

  • Loading branch information...
1 parent 2264161 commit 5d6794ce7b2a0533e5c1d2ba08ea842e9334e099 @poiru poiru committed Mar 17, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 Library/lua/LuaScript.cpp
@@ -59,6 +59,9 @@ bool LuaScript::Initialize(const std::wstring& scriptFile)
fseek(file, 0, SEEK_SET);
fread(fileData, fileSize, 1, file);
+ fclose(file);
+ file = NULL;
+
int load = luaL_loadbuffer(L, fileData, fileSize, "");
delete [] fileData;

0 comments on commit 5d6794c

Please sign in to comment.