mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 12:06:07 +08:00
Fix use after free in CKeyValues3Context::PurgeClusterNodeChain
This commit is contained in:
@ -1612,8 +1612,11 @@ inline void CKeyValues3ContextBase::NodeList<NODE>::Purge()
|
|||||||
template<typename CLUSTER>
|
template<typename CLUSTER>
|
||||||
inline void CKeyValues3Context::PurgeClusterNodeChain( ClusterNodeChain<CLUSTER> &cluster_node )
|
inline void CKeyValues3Context::PurgeClusterNodeChain( ClusterNodeChain<CLUSTER> &cluster_node )
|
||||||
{
|
{
|
||||||
for(auto node = cluster_node.m_pTail; node; node = node->GetPrev())
|
CLUSTER *prev = nullptr;
|
||||||
|
for(auto node = cluster_node.m_pTail; node; node = prev)
|
||||||
{
|
{
|
||||||
|
prev = node->GetPrev();
|
||||||
|
|
||||||
if(node->IsAllocatedOnHeap())
|
if(node->IsAllocatedOnHeap())
|
||||||
{
|
{
|
||||||
node->Purge();
|
node->Purge();
|
||||||
|
Reference in New Issue
Block a user