CWE•Base•Draft•9 recent CVEs
CWE-460Improper Cleanup on Thrown Exception
Description
The product does not clean up its state or incorrectly cleans up its state when an exception is thrown.
Common consequences
- Other→Unexpected State,Varies by ContextExceptions can disturb the flow of the code and prevent the necessary cleanup from happening. This could lead to unexpected state or control flow.
Potential mitigations
- ImplementationIf one breaks from a loop or function by throwing an exception, make sure that cleanup happens or that you should exit the program. Use throwing exceptions sparsely.