ole32: Use CoTaskMemAlloc() instead of IMalloc directly.

This commit is contained in:
Nikolay Sivov 2014-02-09 17:56:38 +04:00 committed by Alexandre Julliard
parent 688cc96ee7
commit d1c4871012
1 changed files with 1 additions and 5 deletions

View File

@ -2215,11 +2215,7 @@ HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id )
*/
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
{
HRESULT ret;
LPMALLOC mllc;
if ((ret = CoGetMalloc(0,&mllc))) return ret;
if (!(*idstr = IMalloc_Alloc( mllc, CHARS_IN_GUID * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
if (!(*idstr = CoTaskMemAlloc(CHARS_IN_GUID * sizeof(WCHAR)))) return E_OUTOFMEMORY;
StringFromGUID2( id, *idstr, CHARS_IN_GUID );
return S_OK;
}