mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 05:10:36 +00:00
ole32: Don't try to read key value if key was not found (Valgrind).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
47043b9295
commit
4e5698f72e
|
@ -1265,13 +1265,17 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
|
|||
}
|
||||
|
||||
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, NULL, &sizeProgId);
|
||||
|
||||
/* get the progId associated to the extension */
|
||||
progId = CoTaskMemAlloc(sizeProgId);
|
||||
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, progId, &sizeProgId);
|
||||
if (!ret)
|
||||
/* return the clsid associated to the progId */
|
||||
res = CLSIDFromProgID(progId,pclsid);
|
||||
if (!ret) {
|
||||
/* get the progId associated to the extension */
|
||||
progId = CoTaskMemAlloc(sizeProgId);
|
||||
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, progId, &sizeProgId);
|
||||
if (!ret)
|
||||
/* return the clsid associated to the progId */
|
||||
res = CLSIDFromProgID(progId, pclsid);
|
||||
else
|
||||
res = HRESULT_FROM_WIN32(ret);
|
||||
CoTaskMemFree(progId);
|
||||
}
|
||||
else
|
||||
res = HRESULT_FROM_WIN32(ret);
|
||||
|
||||
|
@ -1279,7 +1283,6 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
|
|||
CoTaskMemFree(pathDec[i]);
|
||||
CoTaskMemFree(pathDec);
|
||||
|
||||
CoTaskMemFree(progId);
|
||||
return res != S_OK ? MK_E_INVALIDEXTENSION : res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue