1329
...
free(bar);
}
Affected Resources
• Memory
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 742 CERT C Secure Coding Standard (2008) Chapter 9 -
Memory Management (MEM)
734 2345
MemberOf 876 CERT C++ Secure Coding Section 08 - Memory
Management (MEM)
868 2376
MemberOf 969 SFP Secondary Cluster: Faulty Memory Release 888 2404
MemberOf 1162 SEI CERT C Coding Standard - Guidelines 08. Memory
Management (MEM)
1154 2458
MemberOf 1172 SEI CERT C Coding Standard - Guidelines 51.
Microsoft Windows (WIN)
1154 2464
MemberOf 1399 Comprehensive Categorization: Memory Safety 1400 2525
Notes
Other
In C++, if the new operator was used to allocate the memory, it may be allocated with the
malloc(), calloc() or realloc() family of functions in the implementation. Someone aware of this
behavior might choose to map this problem to CWE-590 or to its parent, CWE-762, depending
on their perspective.
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
CERT C Secure Coding MEM34-
C
Exact Only free memory allocated
dynamically
CERT C Secure Coding WIN30-C Imprecise Properly pair allocation and
deallocation functions
Software Fault Patterns SFP12 Faulty Memory Release
References
[REF-480]"Valgrind". < http://valgrind.org/ >.
CWE-591: Sensitive Data Storage in Improperly Locked Memory
Weakness ID : 591
Structure : Simple
Abstraction : Variant
Description
The product stores sensitive data in memory that is not locked, or that has been incorrectly locked,
which might cause the memory to be written to swap files on disk by the virtual memory manager.
This can make the data more accessible to external actors.
Extended Description
CWE Version 4.14
CWE-591: Sensitive Data Storage in Improperly Locked Memory
CWE-591: Sensitive Data Storage in Improperly Locked Memory