Skip to content

Do not double-return arrays to ArrayPool #33767

Description

@terrajobst

The rule should flag cases where a buffer is potentially being returned to the shared pool multiple times, e.g. where a buffer is returned and then still used after the Return; where a method taking an array by ref returns the array but doesn't null out the ref; where there's a return call in a try block, where that same instance is also returned in a catch block, and where something after the return call in the try block could cause an exception that would trigger the same instance to be returned again in the catch; etc.

Category: Reliability

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-ready-for-reviewAPI is ready for review, it is NOT ready for implementationarea-System.Bufferscode-analyzerMarks an issue that suggests a Roslyn analyzer

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions