Commit 723592cf authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

ole32: Release iobject and the IRpcStubBuffer object no matter which code path we take.

Otherwise we would leak a reference for both of these if the ifstub was already created. Fix the FIXME in the code by releasing the stub manager if necessary.
parent 65f1d6a3
...@@ -155,17 +155,18 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno ...@@ -155,17 +155,18 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
/* make sure ifstub that we are creating is unique */ /* make sure ifstub that we are creating is unique */
ifstub = stub_manager_find_ifstub(manager, riid, mshlflags); ifstub = stub_manager_find_ifstub(manager, riid, mshlflags);
if (!ifstub) if (!ifstub)
{
ifstub = stub_manager_new_ifstub(manager, stub, iobject, riid, mshlflags); ifstub = stub_manager_new_ifstub(manager, stub, iobject, riid, mshlflags);
IUnknown_Release(iobject);
if (stub) IRpcStubBuffer_Release(stub); if (stub) IRpcStubBuffer_Release(stub);
if (!ifstub) IUnknown_Release(iobject);
{
stub_manager_int_release(manager); if (!ifstub)
/* FIXME: should we do another release to completely destroy the {
* stub manager? */ stub_manager_int_release(manager);
return E_OUTOFMEMORY; /* destroy the stub manager if it has no ifstubs by releasing
} * zero external references */
stub_manager_ext_release(manager, 0, TRUE);
return E_OUTOFMEMORY;
} }
if (!tablemarshal) if (!tablemarshal)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment