Commit cb6c83df authored by Ove Kaaven's avatar Ove Kaaven Committed by Alexandre Julliard

Properly handle destroying the first connection in the connection

cache.
parent f7b47f7a
......@@ -136,9 +136,13 @@ RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection)
EnterCriticalSection(&conn_cache_cs);
PrevConnection = conn_cache;
while (PrevConnection && PrevConnection->Next != Connection)
PrevConnection = PrevConnection->Next;
if (PrevConnection) PrevConnection->Next = Connection->Next;
if (PrevConnection == Connection) {
conn_cache = Connection->Next;
} else {
while (PrevConnection && PrevConnection->Next != Connection)
PrevConnection = PrevConnection->Next;
if (PrevConnection) PrevConnection->Next = Connection->Next;
}
LeaveCriticalSection(&conn_cache_cs);
RPCRT4_CloseConnection(Connection);
......
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