From c9e4ef73d202d3753041ba6e1fdd18ce1632883b Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Wed, 3 Aug 2005 14:55:05 +0000 Subject: [PATCH] Don't free previous buffer in NdrGetBuffer. --- dlls/rpcrt4/rpc_message.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index 45862dfc384..0dce2e88d84 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -447,19 +447,10 @@ fail: */ RPC_STATUS WINAPI I_RpcGetBuffer(PRPC_MESSAGE pMsg) { - RpcBinding* bind = (RpcBinding*)pMsg->Handle; - TRACE("(%p): BufferLength=%d\n", pMsg, pMsg->BufferLength); /* FIXME: pfnAllocate? */ - if (bind->server) { - /* it turns out that the original buffer data must still be available - * while the RPC server is marshalling a reply, so we should not deallocate - * it, we'll leave deallocating the original buffer to the RPC server */ - pMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, pMsg->BufferLength); - } else { - HeapFree(GetProcessHeap(), 0, pMsg->Buffer); - pMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, pMsg->BufferLength); - } + pMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, pMsg->BufferLength); + TRACE("Buffer=%p\n", pMsg->Buffer); /* FIXME: which errors to return? */ return pMsg->Buffer ? S_OK : E_OUTOFMEMORY;