CWE-584

Return Inside Finally Block
AI Translation Available

The code has a return statement inside a finally block, which will cause any thrown exception in the try block to be discarded.

Status
draft
Abstraction
base

Common Consequences

other
Impacts
alter execution logic

Detection Methods

automated static analysis

Potential Mitigations

Phases:
implementation
Descriptions:
• Do not use a return statement inside the finally block. The finally block should have "cleanup" code.