Commit 43b5f46f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent 9d1232a1
......@@ -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);
......
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