=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: ole32: Fix some leaks ( coverity).

Alexandre Julliard julliard at winehq.org
Tue Nov 27 14:30:50 CST 2012


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

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Mon Nov 26 12:41:42 2012 +0100

ole32: Fix some leaks (coverity).

---

 dlls/ole32/filemoniker.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c
index 37c86ca..7a97100 100644
--- a/dlls/ole32/filemoniker.c
+++ b/dlls/ole32/filemoniker.c
@@ -973,10 +973,17 @@ FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** p
             return nb1;
         nb2=FileMonikerImpl_DecomposePath(pathOther,&stringTable2);
         if (FAILED(nb2))
+        {
+            free_stringtable(stringTable1);
             return nb2;
+        }
 
         if (nb1==0 || nb2==0)
+        {
+            free_stringtable(stringTable1);
+            free_stringtable(stringTable2);
             return MK_E_NOPREFIX;
+        }
 
         commonPath=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(min(lstrlenW(pathThis),lstrlenW(pathOther))+1));
         if (!commonPath)
@@ -1136,10 +1143,15 @@ FileMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppm
 	return res;
 
     len1=FileMonikerImpl_DecomposePath(str1,&tabStr1);
+    if (FAILED(len1))
+        return E_OUTOFMEMORY;
     len2=FileMonikerImpl_DecomposePath(str2,&tabStr2);
 
-    if (FAILED(len1) || FAILED(len2))
-	return E_OUTOFMEMORY;
+    if (FAILED(len2))
+    {
+        free_stringtable(tabStr1);
+        return E_OUTOFMEMORY;
+    }
 
     /* count the number of similar items from the begin of the two paths */
     for(sameIdx=0; ( (tabStr1[sameIdx]!=NULL) &&




More information about the wine-cvs mailing list