Commit 8e667fd8 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Fix potential memory leaks in RPCRT4_Receive.

parent 45481db0
...@@ -813,6 +813,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, ...@@ -813,6 +813,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
void *payload = NULL; void *payload = NULL;
*Header = NULL; *Header = NULL;
pMsg->Buffer = NULL;
TRACE("(%p, %p, %p)\n", Connection, Header, pMsg); TRACE("(%p, %p, %p)\n", Connection, Header, pMsg);
...@@ -964,6 +965,8 @@ fail: ...@@ -964,6 +965,8 @@ fail:
if (CurrentHeader != *Header) if (CurrentHeader != *Header)
RPCRT4_FreeHeader(CurrentHeader); RPCRT4_FreeHeader(CurrentHeader);
if (status != RPC_S_OK) { if (status != RPC_S_OK) {
I_RpcFree(pMsg->Buffer);
pMsg->Buffer = NULL;
RPCRT4_FreeHeader(*Header); RPCRT4_FreeHeader(*Header);
*Header = NULL; *Header = NULL;
} }
......
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