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

Alexandre Julliard julliard at winehq.org
Tue Mar 25 14:27:43 CDT 2014


Module: wine
Branch: master
Commit: 43b5f46fcd39dce13ed3909cb514f156302e1d6e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=43b5f46fcd39dce13ed3909cb514f156302e1d6e

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Mar 25 07:57:49 2014 +0400

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

---

 dlls/ole32/moniker.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/ole32/moniker.c b/dlls/ole32/moniker.c
index 970cc84..d694df9 100644
--- a/dlls/ole32/moniker.c
+++ b/dlls/ole32/moniker.c
@@ -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);
 




More information about the wine-cvs mailing list