rpcrt4: Fix a leak of msg in RPCRT4_io_thread on the error paths.

This commit is contained in:
Rob Shearman 2008-01-08 18:14:27 +00:00 committed by Alexandre Julliard
parent e0c67a189b
commit 5be085dec5

View File

@ -370,15 +370,18 @@ static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg)
}
packet = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcPacket));
if (!packet)
break;
if (!packet) {
HeapFree(GetProcessHeap(), 0, msg);
break;
}
packet->conn = conn;
packet->hdr = hdr;
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());
HeapFree(GetProcessHeap(), 0, packet);
break;
ERR("couldn't queue work item for worker thread, error was %d\n", GetLastError());
HeapFree(GetProcessHeap(), 0, msg);
HeapFree(GetProcessHeap(), 0, packet);
break;
}
msg = NULL;