Author: cwittich
Date: Fri Jan 18 13:34:34 2008
New Revision: 31851
URL:
http://svn.reactos.org/svn/reactos?rev=31851&view=rev
Log:
rpcrt4: Fix a leak of msg in RPCRT4_io_thread on the error paths. <rob at
codeweavers.com>
Modified:
trunk/reactos/dll/win32/rpcrt4/rpc_server.c
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_serve…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/rpc_server.c (original)
+++ trunk/reactos/dll/win32/rpcrt4/rpc_server.c Fri Jan 18 13:34:34 2008
@@ -375,15 +375,18 @@
}
packet = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcPacket));
- if (!packet)
+ 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;
}