[PATCH] ole32: order the releases right (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Jul 20 02:28:23 CDT 2013


 714087 Use after free

Coverity thinks the order of these calls is wrong way and I think
it is... The _int_ release should come after the _ext_ release.

Ciao, Marcus
---
 dlls/ole32/marshal.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c
index ddaaa53..844f603 100644
--- a/dlls/ole32/marshal.c
+++ b/dlls/ole32/marshal.c
@@ -200,10 +200,11 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
 
     if (!ifstub)
     {
-        stub_manager_int_release(manager);
         /* destroy the stub manager if it has no ifstubs by releasing
          * zero external references */
         stub_manager_ext_release(manager, 0, FALSE, TRUE);
+
+        stub_manager_int_release(manager);
         return E_OUTOFMEMORY;
     }
 
-- 
1.7.10.4




More information about the wine-patches mailing list