From 33768740fae0d809accfaf45776768c6e32ab21e Mon Sep 17 00:00:00 2001 From: Arkshine Date: Fri, 15 Jan 2016 17:35:21 +0100 Subject: [PATCH] Fix LoadGameConfigFile returning valid handle on invalid path --- amxmodx/gameconfigs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/amxmodx/gameconfigs.cpp b/amxmodx/gameconfigs.cpp index 40a7dcb4..20911639 100644 --- a/amxmodx/gameconfigs.cpp +++ b/amxmodx/gameconfigs.cpp @@ -24,6 +24,7 @@ static cell AMX_NATIVE_CALL LoadGameConfigFile(AMX *amx, cell *params) if (!ConfigManager.LoadGameConfigFile(filename, &config, error, sizeof(error))) { + ConfigManager.CloseGameConfigFile(config); LogError(amx, AMX_ERR_NATIVE, "Unable to open %s: %s", filename, error); return 0; } @@ -31,7 +32,7 @@ static cell AMX_NATIVE_CALL LoadGameConfigFile(AMX *amx, cell *params) int handle = GameConfigHandle.create(); auto configHandle = GameConfigHandle.lookup(handle); - + if (!configHandle) { return 0;