https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a004233bd3197c13969df…
commit a004233bd3197c13969df0d44f15fc758d84d496
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Apr 16 20:57:02 2019 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Tue Apr 16 20:57:02 2019 +0900
[KERNEL32] Fix handle leak and caching (follow-up of 7e38267)
---
dll/win32/kernel32/winnls/string/japanese.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dll/win32/kernel32/winnls/string/japanese.c
b/dll/win32/kernel32/winnls/string/japanese.c
index 2edbdaeb88..ddee64ffbd 100644
--- a/dll/win32/kernel32/winnls/string/japanese.c
+++ b/dll/win32/kernel32/winnls/string/japanese.c
@@ -82,11 +82,14 @@ BOOL JapaneseEra_IsFirstYearGannen(void)
if (lstrcmpiW(szName, L"InitialEraYear") == 0)
{
s_bFirstIsGannen = (szValue[0] == 0x5143);
- s_bIsCached = TRUE;
break;
}
}
+ NtClose(KeyHandle);
+
+ s_bIsCached = TRUE;
+
return s_bFirstIsGannen;
#endif
}