diff --git a/components/lua/luastate.cpp b/components/lua/luastate.cpp index 4705be5831..889834edc8 100644 --- a/components/lua/luastate.cpp +++ b/components/lua/luastate.cpp @@ -111,8 +111,7 @@ namespace LuaUtil if (!newPtr) { Log(Debug::Error) << "Lua realloc " << osize << "->" << nsize << " failed"; - smallAllocDelta = 0; - bigAllocDelta = 0; + return nullptr; } } self->mTotalMemoryUsage += smallAllocDelta + bigAllocDelta;