From 8e667fd89c48ff577da079ae16dd24598f080303 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Mon, 4 Feb 2008 22:22:47 +0000 Subject: [PATCH] rpcrt4: Fix potential memory leaks in RPCRT4_Receive. --- dlls/rpcrt4/rpc_message.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index 74e0052beb7..068adf177f0 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -813,6 +813,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, void *payload = NULL; *Header = NULL; + pMsg->Buffer = NULL; TRACE("(%p, %p, %p)\n", Connection, Header, pMsg); @@ -964,6 +965,8 @@ fail: if (CurrentHeader != *Header) RPCRT4_FreeHeader(CurrentHeader); if (status != RPC_S_OK) { + I_RpcFree(pMsg->Buffer); + pMsg->Buffer = NULL; RPCRT4_FreeHeader(*Header); *Header = NULL; }