https://git.reactos.org/?p=reactos.git;a=commitdiff;h=05bbbd7d8b5c6c039c8f9…
commit 05bbbd7d8b5c6c039c8f9b3727db522a42e75a33
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Apr 11 10:53:36 2022 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Apr 11 10:53:36 2022 +0900
[NTUSER] Dereference spDefaultImc at UserCreateInputContext (#4446)
Dereference pti->spDefaultImc by UserDereferenceObject if pti->spDefaultImc is
NULL at UserCreateInputContext function. CORE-11700
---
win32ss/user/ntuser/ime.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c
index 1c46bfded3b..7b6c06b9f94 100644
--- a/win32ss/user/ntuser/ime.c
+++ b/win32ss/user/ntuser/ime.c
@@ -1362,6 +1362,8 @@ PIMC FASTCALL UserCreateInputContext(ULONG_PTR dwClientImcData)
else // First time. It's the default IMC.
{
// Add the first one (default) to the list.
+ if (pti->spDefaultImc)
+ UserDereferenceObject(pti->spDefaultImc);
pti->spDefaultImc = pIMC;
pIMC->pImcNext = NULL;
}