Query module NoDisposeCallOnLocalIDisposable

name
Missing Dispose call on local IDisposable
description
Methods that create objects of type ‘IDisposable’ should call ‘Dispose’ on those objects, otherwise unmanaged resources may not be released.
kind
problem
problem.severity
warning
precision
high
id
cs/local-not-disposed
tags
efficiency maintainability external/cwe/cwe-404 external/cwe/cwe-459 external/cwe/cwe-460

Imports

Disposal

Provides predicates for determining whether variables may be disposed.

Dispose
System

Provides definitions related to the namespace System.

csharp

The default C# QL library.

Predicates

escapes

Holds if expression e escapes the local method scope.

isWhitelisted

Holds if the disposable is a whitelisted result.