Skip to content

CancellationTokenSource potential leaks in SignalR HubConnection #57232

@leeriorio

Description

@leeriorio

Describe the bug

there is CancellationTokenSource type variable in src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs

var uploadStreamSource = new CancellationTokenSource();
connectionState.UploadStreamToken = uploadStreamSource.Token;

and in finally block of this private method only Cancel() method calls

How about to Dispose this CTS object in finally block or add using construction in its declaration to eliminate potential memory leaks?

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-signalrIncludes: SignalR clients and servershelp wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions