rpcrt4: Fix potential memory leaks on error paths in RPCRT4_io_thread.

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

View File

@ -391,6 +391,7 @@ static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg)
packet = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcPacket));
if (!packet) {
I_RpcFree(msg->Buffer);
HeapFree(GetProcessHeap(), 0, msg);
break;
}
@ -399,6 +400,7 @@ static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg)
packet->msg = msg;
if (!QueueUserWorkItem(RPCRT4_worker_thread, packet, WT_EXECUTELONGFUNCTION)) {
ERR("couldn't queue work item for worker thread, error was %d\n", GetLastError());
I_RpcFree(msg->Buffer);
HeapFree(GetProcessHeap(), 0, msg);
HeapFree(GetProcessHeap(), 0, packet);
break;