Skip to content
OpenAdvisories

Weakness (CWE)

CWE-404: Improper Resource Shutdown or Release

Class Draft

The product does not release or incorrectly releases a resource before it is made available for re-use.

More detail

When a resource is created or allocated, the developer is responsible for properly releasing the resource as well as accounting for all potential paths of expiration or invalidation, such as a set period of time or revocation.

How to prevent it (4 mitigations)
  1. Requirements

    Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.

    For example, languages such as Java, Ruby, and Lisp perform automatic garbage collection that releases memory for objects that have been deallocated.

  2. Implementation

    It is good practice to be responsible for freeing all resources you allocate and to be consistent with how and where you free memory in a function. If you allocate memory that you intend to free upon completion of the function, you must be sure to free the memory at all exit points for that function including error conditions.

  3. Implementation

    Memory should be allocated/freed using matching functions such as malloc/free, new/delete, and new[]/delete[].

  4. Implementation

    When releasing a complex object or structure, ensure that you properly dispose of all of its member components, not just the object itself.

Source: MITRE CWE-404

2 results · Clear filters · Feed

  • Low 3.3
    CVE-2026-6042 Public exploit

    musl libc GB18030 4-byte Decoder iconv.c iconv algorithmic complexity

    A security flaw has been discovered in musl libc up to 1.2.6. Affected is the function iconv of the file src/locale/iconv.c of the component GB18030 4-byte Decoder. Performing a manipulation results in inefficient algorithmic complexity. The attack must be in…

  • Low 3.3
    CVE-2023-1189 Public exploit

    WiseCleaner Wise Folder Hider IoControlCode WiseFs64.sys 0x222410 denial of service

    A vulnerability was found in WiseCleaner Wise Folder Hider 4.4.3.202. It has been declared as problematic. Affected by this vulnerability is the function 0x222400/0x222404/0x222410 in the library WiseFs64.sys of the component IoControlCode Handler. The manipu…