Commit f566f38e authored by Pierre Schweitzer's avatar Pierre Schweitzer Committed by Alexandre Julliard

msctf: Fix memory leaks.

parent 783683be
...@@ -1013,7 +1013,10 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface, ...@@ -1013,7 +1013,10 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface,
sinkcookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie)); sinkcookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie));
if (!sinkcookie) if (!sinkcookie)
{
HeapFree(GetProcessHeap(), 0, cookie);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
}
cookie->lockType = dwLockFlags; cookie->lockType = dwLockFlags;
cookie->pOwningContext = This->pContext; cookie->pOwningContext = This->pContext;
......
...@@ -924,7 +924,10 @@ static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut) ...@@ -924,7 +924,10 @@ static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut)
if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szwSystemTIPKey, 0, NULL, 0, if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szwSystemTIPKey, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &This->key, NULL) != ERROR_SUCCESS) KEY_READ | KEY_WRITE, NULL, &This->key, NULL) != ERROR_SUCCESS)
{
HeapFree(GetProcessHeap(), 0, This);
return E_FAIL; return E_FAIL;
}
TRACE("returning %p\n", This); TRACE("returning %p\n", This);
*ppOut = (IEnumGUID*)This; *ppOut = (IEnumGUID*)This;
...@@ -1161,7 +1164,10 @@ static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, IEnumTfLanguage ...@@ -1161,7 +1164,10 @@ static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, IEnumTfLanguage
if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szwSystemTIPKey, 0, NULL, 0, if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szwSystemTIPKey, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &This->tipkey, NULL) != ERROR_SUCCESS) KEY_READ | KEY_WRITE, NULL, &This->tipkey, NULL) != ERROR_SUCCESS)
{
HeapFree(GetProcessHeap(), 0, This);
return E_FAIL; return E_FAIL;
}
TRACE("returning %p\n", This); TRACE("returning %p\n", This);
*ppOut = (IEnumTfLanguageProfiles*)This; *ppOut = (IEnumTfLanguageProfiles*)This;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment