From f824c74768c3549536f9998579208abae2117b33 Mon Sep 17 00:00:00 2001 From: Dmitry Tsarevich Date: Wed, 26 Feb 2025 05:43:12 +0300 Subject: [PATCH] client: Do not leak ECON whitelist (item_whitelist.txt) KeyValues --- src/game/shared/econ/econ_item_system.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/shared/econ/econ_item_system.cpp b/src/game/shared/econ/econ_item_system.cpp index aa68d5744..91c5801f2 100644 --- a/src/game/shared/econ/econ_item_system.cpp +++ b/src/game/shared/econ/econ_item_system.cpp @@ -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