From 875281ff63a319e8e6e7ab87196a055d7f66eec8 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 16 Oct 2015 13:28:40 +0000 Subject: [PATCH] [NTOS:EX] - Add missing OBJ_KERNEL_HANDLE and avoid handle leak in ExpGetCurrentUserUILanguage CORE-10207 svn path=/trunk/; revision=69553 --- reactos/ntoskrnl/ex/locale.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/ex/locale.c b/reactos/ntoskrnl/ex/locale.c index 81cddf57488..78e94cfebd8 100644 --- a/reactos/ntoskrnl/ex/locale.c +++ b/reactos/ntoskrnl/ex/locale.c @@ -55,7 +55,7 @@ ExpGetCurrentUserUILanguage(IN PWSTR MuiName, /* Initialize the attributes and open the key */ InitializeObjectAttributes(&ObjectAttributes, &KeyName, - OBJ_CASE_INSENSITIVE, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, UserKey, NULL); Status = ZwOpenKey(&KeyHandle, KEY_QUERY_VALUE,&ObjectAttributes); @@ -88,10 +88,10 @@ ExpGetCurrentUserUILanguage(IN PWSTR MuiName, /* Fail */ Status = STATUS_UNSUCCESSFUL; } - - /* Close the key */ - ZwClose(KeyHandle); } + + /* Close the key */ + ZwClose(KeyHandle); } /* Close the user key and return */ -- 2.17.1