Author: pschweitzer
Date: Wed Dec 7 22:12:17 2011
New Revision: 54609
URL:
http://svn.reactos.org/svn/reactos?rev=54609&view=rev
Log:
[MSCTF]
Fix memory leaks.
Already sent & committed upstream:
http://source.winehq.org/git/wine.git/commit/f566f38e2fd85f05f1291d7b615444…
Modified:
trunk/reactos/dll/win32/msctf/context.c
trunk/reactos/dll/win32/msctf/inputprocessor.c
Modified: trunk/reactos/dll/win32/msctf/context.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/context.c?…
==============================================================================
--- trunk/reactos/dll/win32/msctf/context.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msctf/context.c [iso-8859-1] Wed Dec 7 22:12:17 2011
@@ -1013,7 +1013,10 @@
sinkcookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie));
if (!sinkcookie)
+ {
+ HeapFree(GetProcessHeap(), 0, cookie);
return E_OUTOFMEMORY;
+ }
cookie->lockType = dwLockFlags;
cookie->pOwningContext = This->pContext;
Modified: trunk/reactos/dll/win32/msctf/inputprocessor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/inputproce…
==============================================================================
--- trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] Wed Dec 7 22:12:17 2011
@@ -924,7 +924,10 @@
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 @@
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;