From 7da8d18879f17f54e07a63053e51e6e8534a4e48 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Wed, 7 Dec 2011 22:12:17 +0000 Subject: [PATCH] [MSCTF] Fix memory leaks. Already sent & committed upstream: http://source.winehq.org/git/wine.git/commit/f566f38e2fd85f05f1291d7b6154440887c15a70 svn path=/trunk/; revision=54609 --- reactos/dll/win32/msctf/context.c | 3 +++ reactos/dll/win32/msctf/inputprocessor.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/reactos/dll/win32/msctf/context.c b/reactos/dll/win32/msctf/context.c index 1b4e3cfb546..79a9536fe12 100644 --- a/reactos/dll/win32/msctf/context.c +++ b/reactos/dll/win32/msctf/context.c @@ -1013,7 +1013,10 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface, sinkcookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie)); if (!sinkcookie) + { + HeapFree(GetProcessHeap(), 0, cookie); return E_OUTOFMEMORY; + } cookie->lockType = dwLockFlags; cookie->pOwningContext = This->pContext; diff --git a/reactos/dll/win32/msctf/inputprocessor.c b/reactos/dll/win32/msctf/inputprocessor.c index 34e35c41cb1..d1b6bc60de8 100644 --- a/reactos/dll/win32/msctf/inputprocessor.c +++ b/reactos/dll/win32/msctf/inputprocessor.c @@ -924,7 +924,10 @@ static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut) if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szwSystemTIPKey, 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &This->key, NULL) != ERROR_SUCCESS) + { + HeapFree(GetProcessHeap(), 0, This); return E_FAIL; + } TRACE("returning %p\n", This); *ppOut = (IEnumGUID*)This; @@ -1161,7 +1164,10 @@ static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, IEnumTfLanguage if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szwSystemTIPKey, 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &This->tipkey, NULL) != ERROR_SUCCESS) + { + HeapFree(GetProcessHeap(), 0, This); return E_FAIL; + } TRACE("returning %p\n", This); *ppOut = (IEnumTfLanguageProfiles*)This;