Skip to content

CAT 028

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-028 — HTTP::Client resource leak

Severity: errorConfidence: highAuto-fix:

Warning

This rule flags real bugs, not just performance issues.

Description

HTTP::Client resource leak — HTTP::Client connections must be closed after use. Use the block form or ensure close is called.

Bad code

client = HTTP::Client.new("example.com")
response = client.get("/")

Performance Impact

Tip

This rule can significantly improve performance in hot code paths.

Benchmark

Note

See bench results at bench/cat-028/

Clone this wiki locally