Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by NavBot (vkp) v1.0

...

  1. Anchor
    1
    1
    Setting errno is a POSIX ® ® extension to C99.

Noncompliant Code Example (malloc())

...

This rule appears in the C Secure Coding Standard as MEM32-C. Detect and handle memory allocation errors.

...

Bibliography

Wiki Markup
\[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Section 7.20.3, "Memory management functions"
\[[ISO/IEC 14882-2003|AA. Bibliography#ISO/IEC 14882-2003]\] Section 5.3.4
\[[Meyers 95|AA. Bibliography#Meyers 95]\] Item 7. Be prepared for out-of-memory conditions.
\[[MITRE|AA. Bibliography#MITRE]\] [CWE ID 252|http://cwe.mitre.org/data/definitions/252.html], "Unchecked Return Value"
\[MITRE\] [CWE ID 391|http://cwe.mitre.org/data/definitions/391.html], "Unchecked Error Condition"
\[MITRE\] [CWE ID 476|http://cwe.mitre.org/data/definitions/476.html], "NULL Pointer Dereference"
\[MITRE\] [CWE ID 690|http://cwe.mitre.org/data/definitions/690.html], "Unchecked Return Value to NULL Pointer Dereference"
\[MITRE\] [CWE ID 703|http://cwe.mitre.org/data/definitions/703.html], "Failure to Handle Exceptional Conditions"
\[MITRE\] [CWE ID 754|http://cwe.mitre.org/data/definitions/754.html], "Improper Check for Unusual or Exceptional Conditions"
\[[Seacord 05|AA. Bibliography#Seacord 05]\] Chapter 4, "Dynamic Memory Management"
\[[VU#159523|AA. Bibliography#VU#159523]\]

...

MEM31-CPP. Free dynamically allocated memory exactly once      08. Memory Management (MEM)      MEM34MEM33-CPP. Only free memory allocated dynamicallyEnsure that aborted constructors do not leak