Commit 4e5698f7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Don't try to read key value if key was not found (Valgrind).

parent 47043b92
......@@ -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;
}
......
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