rpcrt4: Fix potential memory leaks in RPCRT4_Receive.

This commit is contained in:
Rob Shearman 2008-02-04 22:22:47 +00:00 committed by Alexandre Julliard
parent 45481db078
commit 8e667fd89c
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}