ole32: Fix some leaks on early returns (Coverity).
This commit is contained in:
parent
9d1232a1ec
commit
43b5f46fcd
|
@ -1248,8 +1248,10 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
|
|||
absFile=pathDec[nbElm-1];
|
||||
|
||||
/* failed if the path represents a directory and not an absolute file name*/
|
||||
if (!lstrcmpW(absFile, bkslashW))
|
||||
if (!lstrcmpW(absFile, bkslashW)) {
|
||||
CoTaskMemFree(pathDec);
|
||||
return MK_E_INVALIDEXTENSION;
|
||||
}
|
||||
|
||||
/* get the extension of the file */
|
||||
extension = NULL;
|
||||
|
@ -1257,8 +1259,10 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
|
|||
for(i = length-1; (i >= 0) && *(extension = &absFile[i]) != '.'; i--)
|
||||
/* nothing */;
|
||||
|
||||
if (!extension || !lstrcmpW(extension, dotW))
|
||||
if (!extension || !lstrcmpW(extension, dotW)) {
|
||||
CoTaskMemFree(pathDec);
|
||||
return MK_E_INVALIDEXTENSION;
|
||||
}
|
||||
|
||||
res=RegQueryValueW(HKEY_CLASSES_ROOT, extension, NULL, &sizeProgId);
|
||||
|
||||
|
|
Loading…
Reference in New Issue