From 0071d924c2537c2372101fa9fe64a2b37b9e2ca8 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 2 Jun 2023 20:54:16 -0400 Subject: [PATCH] Dispose of linked CTS in QuicListener (#87057) --- .../System.Net.Quic/src/System/Net/Quic/QuicListener.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs index a8d115e28e0f5..841ca9b73c913 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs @@ -212,7 +212,7 @@ private async void StartConnectionHandshake(QuicConnection connection, SslClient CancellationToken cancellationToken = default; try { - CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeCts.Token); + using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeCts.Token); linkedCts.CancelAfter(QuicDefaults.HandshakeTimeout); cancellationToken = linkedCts.Token; QuicServerConnectionOptions options = await _connectionOptionsCallback(connection, clientHello, cancellationToken).ConfigureAwait(false);