From 05f12ab6cc7572b7d2acd4184595a5188b8c9bef Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Fri, 12 Jan 2024 00:16:36 +0100 Subject: [PATCH] Tier1: fix CUtlMemoryPool::CBlob structure Only contains the 'previous' pointer, freeing memory now works. --- src/public/tier1/mempool.h | 2 +- src/tier1/mempool.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/public/tier1/mempool.h b/src/public/tier1/mempool.h index 24727d33..ae93f759 100644 --- a/src/public/tier1/mempool.h +++ b/src/public/tier1/mempool.h @@ -69,7 +69,7 @@ protected: class CBlob { public: - CBlob* m_pPrev, * m_pNext; + CBlob* m_pPrev; int m_NumBytes; // Number of bytes in this blob. char m_Data[1]; char m_Padding[3]; // to int align the struct diff --git a/src/tier1/mempool.cpp b/src/tier1/mempool.cpp index 6dadf880..af8229cc 100644 --- a/src/tier1/mempool.cpp +++ b/src/tier1/mempool.cpp @@ -214,7 +214,7 @@ void CUtlMemoryPool::AddNewBlob() // Link it in at the end of the blob list. pBlob->m_NumBytes = blobSize; - pBlob->m_pNext = m_pNext; + pBlob->m_pPrev = m_pNext; m_pNext = pBlob; m_pPrev = (CBlob*)AlignValue(pBlob->m_Data, m_nAlignment);