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,7 +1265,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, NULL, &sizeProgId);
|
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, NULL, &sizeProgId);
|
||||||
|
if (!ret) {
|
||||||
/* get the progId associated to the extension */
|
/* get the progId associated to the extension */
|
||||||
progId = CoTaskMemAlloc(sizeProgId);
|
progId = CoTaskMemAlloc(sizeProgId);
|
||||||
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, progId, &sizeProgId);
|
ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, progId, &sizeProgId);
|
||||||
|
@ -1274,12 +1274,15 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
|
||||||
res = CLSIDFromProgID(progId, pclsid);
|
res = CLSIDFromProgID(progId, pclsid);
|
||||||
else
|
else
|
||||||
res = HRESULT_FROM_WIN32(ret);
|
res = HRESULT_FROM_WIN32(ret);
|
||||||
|
CoTaskMemFree(progId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
res = HRESULT_FROM_WIN32(ret);
|
||||||
|
|
||||||
for(i=0; pathDec[i]!=NULL;i++)
|
for(i=0; pathDec[i]!=NULL;i++)
|
||||||
CoTaskMemFree(pathDec[i]);
|
CoTaskMemFree(pathDec[i]);
|
||||||
CoTaskMemFree(pathDec);
|
CoTaskMemFree(pathDec);
|
||||||
|
|
||||||
CoTaskMemFree(progId);
|
|
||||||
return res != S_OK ? MK_E_INVALIDEXTENSION : res;
|
return res != S_OK ? MK_E_INVALIDEXTENSION : res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue