Skip to content
OpenAdvisories

Weakness (CWE)

CWE-762: Mismatched Memory Management Routines

Variant Incomplete

The product attempts to return a memory resource to the system, but it calls a release function that is not compatible with the function that was originally used to allocate that resource.

How to prevent it (4 mitigations)
  1. Implementation

    Only call matching memory management functions. Do not mix and match routines. For example, when you allocate a buffer with malloc(), dispose of the original pointer with free().

  2. 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.

  3. Architecture and Design

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

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

  4. Architecture and Design

    Use a language that provides abstractions for memory allocation and deallocation.

Source: MITRE CWE-762

14 results · Feed

  • High 7.5

    Junos OS and Junos OS Evolved: A BGP route-processing error causes rpd crash when extended next-hop tunneling and SRv6 service processing are used

    A Mismatched Memory Management Routines vulnerability in the routing protocol daemon (rpd) process of Juniper Networks Junos OS and Junos OS Evolved allows an authenticated network-based attacker to cause a denial of service via a BGP route update when extend…

  • High 7.8

    llama.cpp b1886–b7445 Double Free via llama-android.cpp

    llama.cpp builds b1886 through b7445 contain a double free vulnerability in the LLaMA-Android JNI wrapper where new_1batch() allocates memory using malloc() while free_1batch() deallocates it using the C++ delete operator, causing heap metadata corruption. At…

  • High 7.5

    Apache Thrift: Specially crafted input can crash a c_glib Thrift server with invalid pointer error.

    Mismatched Memory Management Routines vulnerability in Apache Thrift c_glib language bindings. This issue affects Apache Thrift: before 0.23.0. Users are recommended to upgrade to version 0.23.0, which fixes the issue. Description: Specially crafted requests …

  • Medium 5.3

    OGRECave Ogre OgreSTBICodec.cpp encode mismatched memory management routines

    A weakness has been identified in OGRECave Ogre up to 14.4.1. Impacted is the function STBIImageCodec::encode of the file /ogre/PlugIns/STBICodec/src/OgreSTBICodec.cpp. This manipulation causes mismatched memory management routines. The attack is restricted t…

  • High 8.7

    Memory management vulnerability in Absolute Secure Access server versions 9.0 to 13.54

    There is a memory management vulnerability in Absolute Secure Access server versions 9.0 to 13.54. Attackers with network access to the server can cause a Denial of Service by sending a specially crafted sequence of packets to the server. The attack complexit…

  • Low 2.9

    In the spiral-rs crate 0.2.0 for Rust, allocation can be attempted for a ZST (zero-sized type).

  • Low 2.9

    trailer mishandles allocating with a size of zero

    lib.rs in the trailer crate through 0.1.2 for Rust mishandles allocating with a size of zero.

  • High 7.4

    A vulnerability in the Cisco Express Forwarding functionality of Cisco IOS XE Software for Cisco ASR 903 Aggregation Se…

  • High 8.4

    An issue was discovered in Samsung Mobile Processor and Wearable Processor Exynos 850, Exynos 1080, Exynos 2100, Exynos…

  • Low 3.6

    Mismatched Memory Management Routines in editcap

    Memory handling issue in editcap could cause denial of service via crafted capture file

  • High 7.8

    Mismatched Memory Management Routines in Wireshark

    T.38 dissector crash in Wireshark 4.2.0 to 4.0.3 and 4.0.0 to 4.0.13 allows denial of service via packet injection or crafted capture file

  • High 8.1

    Redis vulnerable to integer overflow in certain payloads

    Redis is an in-memory database that persists on disk. Redis incorrectly handles resizing of memory buffers which can result in integer overflow that leads to heap overflow and potential remote code execution. This issue has been patched in version 7.0.15 and …

  • Unscored —

    tsMuxer version git-2539d07 was discovered to contain an alloc-dealloc-mismatch (operator new [] vs operator delete) er…

  • Medium 5.3

    Mismatched Memory Management Routines in Wireshark

    Kafka dissector crash in Wireshark 4.0.0 to 4.0.6 and 3.6.0 to 3.6.14 allows denial of service via packet injection or crafted capture file