From 01770f0e5bf62236efac470894493f516ba5fd08 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Sun, 3 Oct 2004 17:04:29 +0000 Subject: [PATCH] Fixed possible problem where a file handle could stay open on memory allocation failure --- amxmodx/modules.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index dcb4f8ba..9b1d9854 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -616,7 +616,11 @@ int loadModules(const char* filename) CModule* cc = new CModule( path.c_str() ); - if ( cc == 0 ) return loaded; + if ( cc == 0 ) + { + fclose(fp); + return loaded; + } cc->queryModule();