From dae30652e61e62ce999a357ff1ea2a428d09b229 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 23 May 2017 17:39:30 +0200 Subject: [PATCH] rpcrt4: Remove connection from list in RPCRT4_ReleaseConnection. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/rpcrt4/rpc_binding.h | 1 + dlls/rpcrt4/rpc_transport.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/dlls/rpcrt4/rpc_binding.h b/dlls/rpcrt4/rpc_binding.h index 4a24692f091..ff14bbdf68e 100644 --- a/dlls/rpcrt4/rpc_binding.h +++ b/dlls/rpcrt4/rpc_binding.h @@ -91,6 +91,7 @@ typedef struct _RpcConnection RPC_SYNTAX_IDENTIFIER ActiveInterface; USHORT NextCallId; struct list protseq_entry; + struct _RpcServerProtseq *protseq; struct _RpcBinding *server_binding; } RpcConnection; diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index f7d4f78f2c9..6b308c82888 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -227,6 +227,7 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq EnterCriticalSection(&protseq->cs); list_add_head(&protseq->listeners, &Connection->protseq_entry); + Connection->protseq = protseq; LeaveCriticalSection(&protseq->cs); return r; @@ -288,6 +289,7 @@ static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protse EnterCriticalSection(&protseq->cs); list_add_head(&protseq->listeners, &Connection->protseq_entry); + Connection->protseq = protseq; LeaveCriticalSection(&protseq->cs); return r; @@ -1323,6 +1325,7 @@ static RPC_STATUS rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(RpcServerProtseq *pr EnterCriticalSection(&protseq->cs); list_add_tail(&protseq->listeners, &tcpc->common.protseq_entry); + tcpc->common.protseq = protseq; LeaveCriticalSection(&protseq->cs); freeaddrinfo(ai); @@ -3343,6 +3346,13 @@ RPC_STATUS RPCRT4_ReleaseConnection(RpcConnection* Connection) /* server-only */ if (Connection->server_binding) RPCRT4_ReleaseBinding(Connection->server_binding); + if (Connection->protseq) + { + EnterCriticalSection(&Connection->protseq->cs); + list_remove(&Connection->protseq_entry); + LeaveCriticalSection(&Connection->protseq->cs); + } + HeapFree(GetProcessHeap(), 0, Connection); return RPC_S_OK; } -- 2.11.4.GIT