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