1. CVE archive
  2. Vulnerability types
  3. CWE-1341
CWE-1341 · #626 most frequent type in the archive

Multiple Releases of Same Resource or Handle

The product attempts to close or release a resource or handle more than once, without any successful open between the close operations.

Part of: CWE-675 · Multiple Operations on Resource in Single-Operation Context

2CVEs of this type in the archive
1critical (CVSS ≥ 9)
1high severity (7–8.9)
Jun 24, 2026latest published

What it is

The product attempts to close or release a resource or handle more than once, without any successful open between the close operations.

Note that while the implementation for most (if not all) resource reservation allocations involve a unique identifier/pointer/symbolic reference, then if this identifier is reused, checking the identifier for resource closure may result in a false state of openness and closing of the wrong resource. For this reason, reuse of identifiers is discouraged.

Impact on systems

ScopeImpact
Availability, Integrity DoS: Crash, Exit, or Restart
Integrity Modify Memory, Modify Application Data
Depending on the type of resource and the expected API behavior, this could lead to memory corruption, data corruption, or execution path corruption.

How to prevent it

Implementation Change the code's logic so that the resource is only closed once. This might require simplifying or refactoring. This fix can be simple to do in small code blocks, but more difficult when multiple closes are buried within complex conditionals.
Implementation · Refactoring It can be effective to implement a flag that is (1) set when the resource is opened, (2) cleared when it is closed, and (3) checked before closing. This approach can be useful when there are disparate cases in which closes must be performed. However, flag-tracking can increase code complexity and requires diligent compliance by the programmer.
Implementation · Refactoring When closing a resource, set the resource's associated variable to NULL or equivalent value for the given language. Some APIs will ignore this null value without causing errors. For other APIs, this can lead to application crashes or exceptions, which may still be preferable to corrupting an unintended resource such as memory or data.

Source: MITRE CWE catalog · Official entry on the MITRE website

All CWE-1341 CVEs

2 results

Dottor Marc

Is this type of vulnerability in your systems?

An archive tells you what exists; a Vulnerability Assessment tells you what is exposed on your side. Dottor Marc tests your web applications and network with automated and manual checks.