From bb2388c15bd98355b0076bf995e905530fa85215 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Fri, 2 Apr 2021 20:49:51 -0400 Subject: [PATCH] Add a missing fclose in jitutils MethodSet constructor (#50282) The file methodSetFile is never used outside of the constructor, but the file is never closed, leaking a resource handle. Lets close it manually. --- src/coreclr/jit/utils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/coreclr/jit/utils.cpp b/src/coreclr/jit/utils.cpp index cf1494c..26914f1 100644 --- a/src/coreclr/jit/utils.cpp +++ b/src/coreclr/jit/utils.cpp @@ -1707,6 +1707,11 @@ MethodSet::MethodSet(const WCHAR* filename, HostAllocator alloc) : m_pInfos(null } } + if (fclose(methodSetFile)) + { + JITDUMP("Unable to close %ws\n", filename); + } + if (m_pInfos == nullptr) { JITDUMP("No methods read from %ws\n", filename); -- 2.7.4