Commit 5be085de authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

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

parent e0c67a18
......@@ -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;
......
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