Rob Shearman : rpcrt4: Fix a memory leak in I_RpcSendReceive caused by I_RpcReceive overwriting pMsg- >Buffer.
Module: wine Branch: master Commit: ca6fe3fbf249feb4c06fec3b613e21b644fa065e URL: http://source.winehq.org/git/wine.git/?a=commit;h=ca6fe3fbf249feb4c06fec3b61... Author: Rob Shearman <rob(a)codeweavers.com> Date: Wed Feb 21 17:12:41 2007 +0000 rpcrt4: Fix a memory leak in I_RpcSendReceive caused by I_RpcReceive overwriting pMsg->Buffer. (Reported by Huw Davies.) --- dlls/rpcrt4/rpc_message.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index 574316d..8a02463 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -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; }
participants (1)
-
Alexandre Julliard