From aa808d63bc68e0e52970c524c7aad758a5cf15a7 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 21 Aug 2024 16:40:39 +0200 Subject: [PATCH] Return nullptr straight away --- components/lua/luastate.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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;