Commit ca6fe3fb authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Fix a memory leak in I_RpcSendReceive caused by I_RpcReceive overwriting pMsg->Buffer.

(Reported by Huw Davies.)
parent b491d926
......@@ -1030,10 +1030,16 @@ fail:
RPC_STATUS WINAPI I_RpcSendReceive(PRPC_MESSAGE pMsg)
{
RPC_STATUS status;
RPC_MESSAGE original_message;
TRACE("(%p)\n", pMsg);
original_message = *pMsg;
status = I_RpcSend(pMsg);
if (status == RPC_S_OK)
status = I_RpcReceive(pMsg);
/* free the buffer replaced by a new buffer in I_RpcReceive */
if (status == RPC_S_OK)
I_RpcFreeBuffer(&original_message);
return status;
}
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