From 93dfdf7a3f4c29308fbfebc85f58bcea51b2efb4 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Thu, 26 Oct 2006 12:38:27 +0100 Subject: [PATCH] ole32: Fix some memory leaks in the class factory proxy. --- dlls/ole32/oleproxy.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c index 9a35b858bbd..889e03c914e 100644 --- a/dlls/ole32/oleproxy.c +++ b/dlls/ole32/oleproxy.c @@ -382,11 +382,14 @@ static HRESULT WINAPI CFProxy_CreateInstance( hres = IRpcChannelBuffer_SendReceive(This->chanbuf,&msg,&srstatus); if (hres) { FIXME("IRpcChannelBuffer_SendReceive failed with %x?\n",hres); + IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg); return hres; } - if (!msg.cbBuffer) /* interface not found on remote */ + if (!msg.cbBuffer) { /* interface not found on remote */ + IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg); return srstatus; + } /* We got back: [Marshalled Interface data] */ TRACE("got %d bytes data.\n",msg.cbBuffer); @@ -395,6 +398,7 @@ static HRESULT WINAPI CFProxy_CreateInstance( hres = CreateStreamOnHGlobal(hGlobal,TRUE,&pStream); if (hres) { FIXME("CreateStreamOnHGlobal failed with %x\n",hres); + IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg); return hres; } hres = CoUnmarshalInterface( @@ -403,6 +407,9 @@ static HRESULT WINAPI CFProxy_CreateInstance( ppv ); IStream_Release(pStream); /* Does GlobalFree hGlobal too. */ + + IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg); + if (hres) { FIXME("CoMarshalInterface failed, %x\n",hres); return hres;