Rob Shearman : ole32: Fix a leak of the IBindCtx object in FileMonikerImpl_IsEqual.

Alexandre Julliard julliard at winehq.org
Mon Nov 12 06:27:10 CST 2007


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Sat Nov 10 16:05:42 2007 +0000

ole32: Fix a leak of the IBindCtx object in FileMonikerImpl_IsEqual.

---

 dlls/ole32/filemoniker.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c
index cc8eae9..8702d0f 100644
--- a/dlls/ole32/filemoniker.c
+++ b/dlls/ole32/filemoniker.c
@@ -793,13 +793,15 @@ FileMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
     res = CreateBindCtx(0,&bind);
     if (FAILED(res)) return res;
 
+    res = S_FALSE;
     if (SUCCEEDED(IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&filePath))) {
-	int result = lstrcmpiW(filePath, This->filePathName);
+	if (!lstrcmpiW(filePath, This->filePathName))
+            res = S_OK;
 	CoTaskMemFree(filePath);
-        if ( result == 0 ) return S_OK;
     }
-    return S_FALSE;
 
+    IBindCtx_Release(bind);
+    return res;
 }
 
 /******************************************************************************




More information about the wine-cvs mailing list