Release connections, timers, locks, and file handles in finally so they are freed on both success and error paths. Cleanup in the try body alone leaks on failure.
Why This Matters
Resources released only on the success path leak whenever an error is thrown, eventually exhausting connection pools or file handles.
Related Rules
Catch this automatically on every PR
BeforeMerge scans your pull requests against this rule and dozens more. Get actionable feedback before code ships.