rpcrt4: Set the fBufferValid flag in NdrProxyGetBuffer.

Only call IRpcChannelBuffer_FreeBuffer in NdrProxyFreeBuffer if 
fBufferValid is set.
This commit is contained in:
Rob Shearman 2008-01-08 12:02:55 +00:00 committed by Alexandre Julliard
parent 974b4d2c95
commit 9ff15252d0
1 changed files with 8 additions and 4 deletions

View File

@ -364,6 +364,7 @@ void WINAPI NdrProxyGetBuffer(void *This,
RpcRaiseException(hr);
return;
}
pStubMsg->fBufferValid = TRUE;
pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer;
pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength;
pStubMsg->Buffer = pStubMsg->BufferStart;
@ -408,11 +409,14 @@ void WINAPI NdrProxySendReceive(void *This,
void WINAPI NdrProxyFreeBuffer(void *This,
PMIDL_STUB_MESSAGE pStubMsg)
{
HRESULT hr;
TRACE("(%p,%p)\n", This, pStubMsg);
hr = IRpcChannelBuffer_FreeBuffer(pStubMsg->pRpcChannelBuffer,
(RPCOLEMESSAGE*)pStubMsg->RpcMsg);
if (pStubMsg->fBufferValid)
{
IRpcChannelBuffer_FreeBuffer(pStubMsg->pRpcChannelBuffer,
(RPCOLEMESSAGE*)pStubMsg->RpcMsg);
pStubMsg->fBufferValid = TRUE;
}
}
/***********************************************************************