rpcrt4: Don't call IUnknown_AddRef if there is no outer unknown in

StdProxy_Construct as it will just crash anyway.
This commit is contained in:
Robert Shearman 2006-02-07 16:24:33 +01:00 committed by Alexandre Julliard
parent 21fb7ab6a1
commit b7bf68f4d0
1 changed files with 5 additions and 1 deletions

View File

@ -188,7 +188,11 @@ HRESULT WINAPI StdProxy_Construct(REFIID riid,
This->pChannel = NULL;
*ppProxy = (LPRPCPROXYBUFFER)&This->lpVtbl;
*ppvObj = &This->PVtbl;
IUnknown_AddRef((IUnknown *)*ppvObj);
/* if there is no outer unknown then the caller will control the lifetime
* of the proxy object through the proxy buffer, so no need to increment the
* ref count of the proxy object */
if (pUnkOuter)
IUnknown_AddRef((IUnknown *)*ppvObj);
IPSFactoryBuffer_AddRef(pPSFactory);
return S_OK;