CWE-584

Return Inside Finally Block

Medium

Description

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

Potential Impact

How to Fix

Implementation

Do not use a return statement inside the finally block. The finally block should have "cleanup" code.

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-584 vulnerabilities in your codebase.

Get Security Assessment