[PATCH]ole32: compositemoniker unreached released code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This (untested) patch below hopefully fixes a bug from the
evil "Smatch buglist".

Patch against 20030709.

Comments welcome.

Cheers,

Alex.

Fix potentially unreached release code in
CompositeMonikerImpl_IsEqual.

diff -urN wine-20030709.old/dlls/ole32/compositemoniker.c
wine-20030709/dlls/ole32/compositemoniker.c
--- wine-20030709.old/dlls/ole32/compositemoniker.c    
2003-06-18 05:30:40.000000000 +0200
+++ wine-20030709/dlls/ole32/compositemoniker.c 2003-08-14
15:03:41.000000000 +0200
@@ -845,28 +845,20 @@

     IMoniker_Enum(iface,TRUE,&enumMoniker2);

-    while(1){
+    res = res1 = res2 = S_OK
+    /* end loop if either */
+    /* - both components are different ( res == S_FALSE ), or */
+    /* - both enum are at end ( res1 == S_FALSE and res2 ==
S_FALSE ) */
+    while (res == S_OK
+        && !(res1 == S_FALSE && res2 == S_FALSE)) {

         res1=IEnumMoniker_Next(enumMoniker1,1,&tempMk1,NULL);
         res2=IEnumMoniker_Next(enumMoniker2,1,&tempMk2,NULL);

-        if((res1==S_OK)&&(res2==S_OK)){
-
-            if(IMoniker_IsEqual(tempMk1,tempMk2)==S_FALSE){
-                res= S_FALSE;
-                break;
-            }
-            else
-                continue;
-        }
-        else if ( (res1==S_FALSE) && (res2==S_FALSE) ){
-                res = S_OK;
-                break;
-        }
-        else{
+        if ((res1 == S_OK) && (res2 == S_OK))
+            res = IMoniker_IsEqual(tempMk1, tempMk2);
+        else
             res = S_FALSE;
-            break;
-        }

         if (res1==S_OK)
             IMoniker_Release(tempMk1);



Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34?/mn) ; tél : 08 92 68 13 50 (0,34?/mn)






[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux