Back

LL015

Use FreeAndNil

Object Pascal — Delphi & Free Pascal
Warning
Reliability

Nil assignment after free reduces accidental use-after-free patterns

nil assignment after free reduces accidental use-after-free patterns.

Why this severity

nil assignment after free reduces accidental use-after-free patterns.


Known false positives

ownership handled by interfaces or ARC-like lifetime management.

Remediation example

FreeAndNil(FConnection);

Reconnecting… Connection lost. Reload