client: Do not leak ECON whitelist (item_whitelist.txt) KeyValues

This commit is contained in:
Dmitry Tsarevich 2025-02-26 05:43:12 +03:00 committed by EricS-Valve
parent b2a7d26493
commit f824c74768

View File

@ -177,10 +177,14 @@ void CEconItemSystem::ReloadWhitelist( void )
// If we didn't find a file, we're done.
if ( !bFoundWhitelist )
{
pWhitelistKV->deleteThis();
return;
}
// Otherwise, go through the KVs and turn on the matching items.
Msg("Parsing item whitelist (default: %s)\n", bDefault ? "allowed" : "disallowed" );
KeyValues* ownerWhitelistKV = pWhitelistKV;
pWhitelistKV = pWhitelistKV->GetFirstSubKey();
while ( pWhitelistKV )
{
@ -204,6 +208,8 @@ void CEconItemSystem::ReloadWhitelist( void )
pWhitelistKV = pWhitelistKV->GetNextKey();
}
Msg("Finished.\n");
ownerWhitelistKV->deleteThis();
}
#ifdef GAME_DLL