Fix uninitialized variable error
authorest31 <MTest31@outlook.com>
Tue, 2 Jun 2015 11:55:02 +0000 (13:55 +0200)
committerest31 <MTest31@outlook.com>
Tue, 2 Jun 2015 11:55:02 +0000 (13:55 +0200)
If you run minetest with valgrind, you'll quickly notice uninitialized jump
depend error messages that point to s_base.cpp:131. This commit fixes those.

src/script/cpp_api/s_base.cpp

index 4fb8411efe79d2abec05df7b8762d41ba3978b31..8b0b16bfb13064c9cd3a7b5e04eb04c5df35dd7f 100644 (file)
@@ -103,6 +103,11 @@ ScriptApiBase::ScriptApiBase()
        lua_pushstring(m_luastack, porting::getPlatformName());
        lua_setglobal(m_luastack, "PLATFORM");
 
+       // m_secure gets set to true inside
+       // ScriptApiSecurity::initializeSecurity(), if neccessary.
+       // Default to false otherwise
+       m_secure = false;
+
        m_server = NULL;
        m_environment = NULL;
        m_guiengine = NULL;