ole32: Fix some leaks on early returns (Coverity).

This commit is contained in:
Nikolay Sivov 2014-03-25 07:57:49 +04:00 committed by Alexandre Julliard
parent 9d1232a1ec
commit 43b5f46fcd
1 changed files with 6 additions and 2 deletions

View File

@ -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);