From 2c3f099e16d5b91119bde5aae79dfae8efa89a7a Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Fri, 10 Feb 2023 21:14:21 +0900 Subject: [PATCH] ime: fixed memory leak --- src/subs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/subs.c b/src/subs.c index e98089d..400c20e 100644 --- a/src/subs.c +++ b/src/subs.c @@ -455,7 +455,7 @@ HKL PASCAL GetMyHKL() dwSize = GetKeyboardLayoutList(0, NULL); - lphkl = (HKL *)GlobalAlloc(GPTR, dwSize * sizeof(DWORD)); + lphkl = (HKL *)GlobalAlloc(GPTR, dwSize * sizeof(HKL)); if (!lphkl) return NULL; @@ -467,7 +467,7 @@ HKL PASCAL GetMyHKL() { TCHAR szFile[32]; HKL hKLTemp = *(lphkl + dwi); - ImmGetIMEFileName(hKLTemp, szFile, sizeof(szFile)); + ImmGetIMEFileName(hKLTemp, szFile, sizeof(szFile) / sizeof(TCHAR)); if (!lstrcmpi(szFile, MyFileName)) {