1596
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 969 SFP Secondary Cluster: Faulty Memory Release 888 2404
MemberOf 1399 Comprehensive Categorization: Memory Safety 1400 2525
Notes
Maintenance
Currently, CWE-763 is the parent, however it may be desirable to have an intermediate parent
which is not function-specific, similar to how CWE-762 is an intermediate parent between
CWE-763 and CWE-590.
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
Software Fault Patterns SFP12 Faulty Memory Release
References
[REF-657]"boost C++ Library Smart Pointers". < https://www.boost.org/doc/libs/1_38_0/libs/
smart_ptr/smart_ptr.htm >.2023-04-07.
[REF-480]"Valgrind". < http://valgrind.org/ >.
CWE-762: Mismatched Memory Management Routines
Weakness ID : 762
Structure : Simple
Abstraction : Variant
Description
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.
Extended Description
This weakness can be generally described as mismatching memory management routines, such
as:
• The memory was allocated on the stack (automatically), but it was deallocated using the
memory management routine free() (CWE-590), which is intended for explicitly allocated heap
memory.
• The memory was allocated explicitly using one set of memory management functions, and
deallocated using a different set. For example, memory might be allocated with malloc() in C+
+ instead of the new operator, and then deallocated with the delete operator.
When the memory management functions are mismatched, the consequences may be as severe
as code execution, memory corruption, or program crash. Consequences and ease of exploit will
vary depending on the implementation of the routines and the object being managed.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
CWE Version 4.14
CWE-762: Mismatched Memory Management Routines
CWE-762: Mismatched Memory Management Routines