rpcrt4: Set the fBufferValid flag in NdrProxyGetBuffer.
Only call IRpcChannelBuffer_FreeBuffer in NdrProxyFreeBuffer if fBufferValid is set.
This commit is contained in:
parent
974b4d2c95
commit
9ff15252d0
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
Loading…
Reference in New Issue