Skip to content
OpenAdvisories

Weakness (CWE)

CWE-401: Missing Release of Memory after Effective Lifetime

Variant Draft

The product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse.

How to prevent it (3 mitigations)
  1. Implementation

    Choose a language or tool that provides automatic memory management, or makes manual memory management less error-prone.

    For example, glibc in Linux provides protection against free of invalid pointers.

    When using Xcode to target OS X or iOS, enable automatic reference counting (ARC) [REF-391].

    To help correctly and consistently manage memory when programming in C++, consider using a smart pointer class such as std::auto_ptr (defined by ISO/IEC ISO/IEC 14882:2003), std::shared_ptr and std::unique_ptr (specified by an upcoming revision of the C++ standard, informally referred to as C++ 1x), or equivalent solutions such as Boost.

  2. Architecture and Design

    Use an abstraction library to abstract away risky APIs. Not a complete solution.

  3. Architecture and Design, Build and Compilation

    Consider using the Boehm-Demers-Weiser garbage collector (bdwgc), which can help avoid leaks.

Source: MITRE CWE-401

789 results · Feed

  • Medium 5.5

    tracing: kprobe: Fix memory leak in test_gen_kprobe/kretprobe_cmd()

    In the Linux kernel, the following vulnerability has been resolved: tracing: kprobe: Fix memory leak in test_gen_kprobe/kretprobe_cmd() test_gen_kprobe_cmd() only free buf in fail path, hence buf will leak when there is no failure. Move kfree(buf) from fail p…

  • Medium 5.5

    capabilities: fix potential memleak on error path from vfs_getxattr_alloc()

    In the Linux kernel, the following vulnerability has been resolved: capabilities: fix potential memleak on error path from vfs_getxattr_alloc() In cap_inode_getsecurity(), we will use vfs_getxattr_alloc() to complete the memory allocation of tmpbuf, if we hav…

  • Medium 5.5

    wifi: cfg80211: fix memory leak in query_regdb_file()

    In the Linux kernel, the following vulnerability has been resolved: wifi: cfg80211: fix memory leak in query_regdb_file() In the function query_regdb_file() the alpha2 parameter is duplicated using kmemdup() and subsequently freed in regdb_fw_cb(). However, r…

  • Medium 5.5

    bpf, verifier: Fix memory leak in array reallocation for stack state

    In the Linux kernel, the following vulnerability has been resolved: bpf, verifier: Fix memory leak in array reallocation for stack state If an error (NULL) is returned by krealloc(), callers of realloc_array() were setting their allocation pointers to NULL, b…

  • Medium 5.5

    HID: hyperv: fix possible memory leak in mousevsc_probe()

    In the Linux kernel, the following vulnerability has been resolved: HID: hyperv: fix possible memory leak in mousevsc_probe() If hid_add_device() returns error, it should call hid_destroy_device() to free hid_dev which is allocated in hid_allocate_device().

  • Medium 5.5

    net: tun: Fix memory leaks of napi_get_frags

    In the Linux kernel, the following vulnerability has been resolved: net: tun: Fix memory leaks of napi_get_frags kmemleak reports after running test_progs: unreferenced object 0xffff8881b1672dc0 (size 232): comm "test_progs", pid 394388, jiffies 4354712116 (a…

  • Medium 5.5

    net: wwan: iosm: fix memory leak in ipc_wwan_dellink

    In the Linux kernel, the following vulnerability has been resolved: net: wwan: iosm: fix memory leak in ipc_wwan_dellink IOSM driver registers network device without setting the needs_free_netdev flag, and does NOT call free_netdev() when unregisters network …

  • Medium 5.5

    net: wwan: mhi: fix memory leak in mhi_mbim_dellink

    In the Linux kernel, the following vulnerability has been resolved: net: wwan: mhi: fix memory leak in mhi_mbim_dellink MHI driver registers network device without setting the needs_free_netdev flag, and does NOT call free_netdev() when unregisters network de…

  • Medium 5.5

    dmaengine: ti: k3-udma-glue: fix memory leak when register device fail

    In the Linux kernel, the following vulnerability has been resolved: dmaengine: ti: k3-udma-glue: fix memory leak when register device fail If device_register() fails, it should call put_device() to give up reference, the name allocated in dev_set_name() can b…

  • Medium 5.5

    net: marvell: prestera: fix memory leak in prestera_rxtx_switch_init()

    In the Linux kernel, the following vulnerability has been resolved: net: marvell: prestera: fix memory leak in prestera_rxtx_switch_init() When prestera_sdma_switch_init() failed, the memory pointed to by sw->rxtx isn't released. Fix it. Only be compiled, not…

  • Medium 5.5

    net: wwan: iosm: fix memory leak in ipc_pcie_read_bios_cfg

    In the Linux kernel, the following vulnerability has been resolved: net: wwan: iosm: fix memory leak in ipc_pcie_read_bios_cfg ipc_pcie_read_bios_cfg() is using the acpi_evaluate_dsm() to obtain the wwan power state configuration from BIOS but is not freeing …

  • Medium 5.5

    net: macvlan: fix memory leaks of macvlan_common_newlink

    In the Linux kernel, the following vulnerability has been resolved: net: macvlan: fix memory leaks of macvlan_common_newlink kmemleak reports memory leaks in macvlan_common_newlink, as follows: ip link add link eth0 name .. type macvlan mode source macaddr ad…

  • Medium 5.5

    bpf: Fix memory leaks in __check_func_call

    In the Linux kernel, the following vulnerability has been resolved: bpf: Fix memory leaks in __check_func_call kmemleak reports this issue: unreferenced object 0xffff88817139d000 (size 2048): comm "test_progs", pid 33246, jiffies 4307381979 (age 45851.820s) h…

  • Medium 6.5

    Libsoup: memory leak on soup_header_parse_quality_list() via soup-headers.c

    A flaw was found in libsoup. It is vulnerable to memory leaks in the soup_header_parse_quality_list() function when parsing a quality list that contains elements with all zeroes.

  • Low 3.3

    can: etas_es58x: es58x_rx_err_msg(): fix memory leak in error path

    In the Linux kernel, the following vulnerability has been resolved: can: etas_es58x: es58x_rx_err_msg(): fix memory leak in error path In es58x_rx_err_msg(), if can->do_set_mode() fails, the function directly returns without calling netif_rx(skb). This means …

  • High 7.5

    Junos OS: SRX Series: On devices with Anti-Virus enabled, malicious server responses will cause memory to leak ultimately causing forwarding to stop

    A Missing Release of Memory after Effective Lifetime vulnerability in the Anti-Virus processing of Juniper Networks Junos OS on SRX Series allows an unauthenticated, network-based attacker to cause a Denial-of-Service (DoS). On all SRX platforms with Anti-Vir…

  • Medium 6.5

    Junos OS: MX Series: Subscriber login/logout activity will lead to a memory leak

    A Missing Release of Memory after Effective Lifetime vulnerability in the packet forwarding engine (PFE) of Juniper Networks Junos OS on MX Series allows an unauthenticated adjacent attacker to cause a Denial-of-Service (DoS). In a subscriber management scena…

  • Medium 6.5

    Junos OS and Junos OS Evolved: In an EVPN-VXLAN scenario specific ARP or NDP packets cause FPC to crash

    A Missing Release of Memory after Effective Lifetime vulnerability in the Packet Forwarding Engine (PFE) of Juniper Networks Junos OS and Junos OS Evolved allows an adjacent, unauthenticated attacker to cause an FPC to crash, leading to Denial of Service (DoS…

  • Low 3.3

    third_party_NuttX has a memory leak vulnerability

    in OpenHarmony v5.0.2 and prior versions allow a local attacker case DOS through missing release of memory.

  • Low 3.3

    GNU Binutils objdump bucomm.c display_info memory leak

    A vulnerability has been found in GNU Binutils 2.43/2.44 and classified as problematic. Affected by this vulnerability is the function display_info of the file binutils/bucomm.c of the component objdump. The manipulation leads to memory leak. An attack has to…

  • Medium 5.5

    ipv6: Fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw().

    In the Linux kernel, the following vulnerability has been resolved: ipv6: Fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw(). fib_check_nh_v6_gw() expects that fib6_nh_init() cleans up everything when it fails. Commit 7dd73168e273 ("ipv6: Always alloc…

  • Medium 5.5

    mm/huge_memory: drop beyond-EOF folios with the right number of refs

    In the Linux kernel, the following vulnerability has been resolved: mm/huge_memory: drop beyond-EOF folios with the right number of refs When an after-split folio is large and needs to be dropped due to EOF, folio_put_refs(folio, folio_nr_pages(folio)) should…

  • Medium 5.5

    ice: fix memory leak in aRFS after reset

    In the Linux kernel, the following vulnerability has been resolved: ice: fix memory leak in aRFS after reset Fix aRFS (accelerated Receive Flow Steering) structures memory leak by adding a checker to verify if aRFS memory is already allocated while configurin…

  • Medium 6.5

    Infinispan: infinispan: rest compare api has buffer leak

    A vulnerability was found in the Infinispan component in Red Hat Data Grid. The REST compare API may have a buffer leak and an out of memory error can occur when sending continual requests with large POST data to the REST API.

  • High 7.8

    Revert "wifi: mac80211: fix memory leak in ieee80211_if_add()"

    In the Linux kernel, the following vulnerability has been resolved: Revert "wifi: mac80211: fix memory leak in ieee80211_if_add()" This reverts commit 13e5afd3d773c6fc6ca2b89027befaaaa1ea7293. ieee80211_if_free() is already called from free_netdev(ndev) becau…

  • Medium 5.5

    Bluetooth: hci_sync: fix memory leak in hci_update_adv_data()

    In the Linux kernel, the following vulnerability has been resolved: Bluetooth: hci_sync: fix memory leak in hci_update_adv_data() When hci_cmd_sync_queue() failed in hci_update_adv_data(), inst_ptr is not freed, which will cause memory leak, convert to use ER…

  • Medium 5.5

    Bluetooth: hci_conn: Fix memory leaks

    In the Linux kernel, the following vulnerability has been resolved: Bluetooth: hci_conn: Fix memory leaks When hci_cmd_sync_queue() failed in hci_le_terminate_big() or hci_le_big_terminate(), the memory pointed by variable d is not freed, which will cause mem…

  • Medium 5.5

    dmaengine: tegra: Fix memory leak in terminate_all()

    In the Linux kernel, the following vulnerability has been resolved: dmaengine: tegra: Fix memory leak in terminate_all() Terminate vdesc when terminating an ongoing transfer. This will ensure that the vdesc is present in the desc_terminated list The descripto…

  • Medium 5.5

    cifs: fix potential memory leaks in session setup

    In the Linux kernel, the following vulnerability has been resolved: cifs: fix potential memory leaks in session setup Make sure to free cifs_ses::auth_key.response before allocating it as we might end up leaking memory in reconnect or mounting.

  • Medium 5.5

    drm/i915: Fix a memory leak with reused mmap_offset

    In the Linux kernel, the following vulnerability has been resolved: drm/i915: Fix a memory leak with reused mmap_offset drm_vma_node_allow() and drm_vma_node_revoke() should be called in balanced pairs. We call drm_vma_node_allow() once per-file everytime a u…

  • Medium 5.5

    firewire: fix memory leak for payload of request subaction to IEC 61883-1 FCP region

    In the Linux kernel, the following vulnerability has been resolved: firewire: fix memory leak for payload of request subaction to IEC 61883-1 FCP region This patch is fix for Linux kernel v2.6.33 or later. For request subaction to IEC 61883-1 FCP region, Linu…

  • Medium 5.5

    net: openvswitch: fix flow memory leak in ovs_flow_cmd_new

    In the Linux kernel, the following vulnerability has been resolved: net: openvswitch: fix flow memory leak in ovs_flow_cmd_new Syzkaller reports a memory leak of new_flow in ovs_flow_cmd_new() as it is not freed when an allocation of a key fails. BUG: memory …

  • Medium 5.5

    EDAC/highbank: Fix memory leak in highbank_mc_probe()

    In the Linux kernel, the following vulnerability has been resolved: EDAC/highbank: Fix memory leak in highbank_mc_probe() When devres_open_group() fails, it returns -ENOMEM without freeing memory allocated by edac_mc_alloc(). Call edac_mc_free() on the error …

  • Medium 5.5

    dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init

    In the Linux kernel, the following vulnerability has been resolved: dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init If the function sdma_load_context() fails, the sdma_desc will be freed, but the allocated desc->bd is forgot to be freed.…

  • Medium 5.5

    fbdev: smscufx: fix error handling code in ufx_usb_probe

    In the Linux kernel, the following vulnerability has been resolved: fbdev: smscufx: fix error handling code in ufx_usb_probe The current error handling code in ufx_usb_probe have many unmatching issues, e.g., missing ufx_free_usb_list, destroy_modedb label sh…

  • Medium 5.5

    kernel/irq/irqdomain.c: fix memory leak with using debugfs_lookup()

    In the Linux kernel, the following vulnerability has been resolved: kernel/irq/irqdomain.c: fix memory leak with using debugfs_lookup() When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make t…

  • Medium 5.5

    HV: hv_balloon: fix memory leak with using debugfs_lookup()

    In the Linux kernel, the following vulnerability has been resolved: HV: hv_balloon: fix memory leak with using debugfs_lookup() When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things si…

  • Medium 6.5

    libming v0.4.8 was discovered to contain a memory leak via the parseSWF_ENABLEDEBUGGER2 function.

  • Medium 5.5

    CryptoLib's crypto_handle_incrementing_nontransmitted_counter Function has Memory Leak

    CryptoLib provides a software-only solution using the CCSDS Space Data Link Security Protocol - Extended Procedures (SDLS-EP) to secure communications between a spacecraft running the core Flight System (cFS) and a ground station. A memory leak vulnerability …

  • Medium 5.6

    Memory Leak vulnerability in SoftEtherVPN 5.02.5187 allows an attacker to cause a denial of service via the UnixMemoryA…