Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Wiki MarkupAs noted in [undefined behavior 169|CC. Undefined Behavior#ub_ 169] of Annex J of \ [[ISO/IEC 9899-1999|AA. Bibliography#ISO/IEC 9899-1999]\], the behavior a program is [undefined |BB. Definitions#undefined behavior] when

the pointer argument to the free or realloc function does not match a pointer earlier returned by calloc, malloc, or realloc, or the space has been deallocated by a call to free or realloc.

...

Tool

Version

Checker

Description

Section

LDRA tool suite

Include Page
c:LDRA_Vc:
LDRA_V
Section

483 S

Section

Fully Implemented

Section

Coverity Prevent

Include Page
c:Coverity_Vc:
Coverity_V
Section

BAD_FREE

Section

identifies calls to free() where the argument is a pointer to a function or an array. It also detects the cases where Free is used on an address-of expression, which can never be heap allocated. Coverity Prevent cannot discover all violations of this rule, so further verification is necessary

Section

Klocwork

Include Page
c:Klocwork_Vc:
Klocwork_V
Section

FNH.MIGHT
FNH.MUST
FUM.GEN.MIGHT
FUM.GEN.MUST

 

Section

Compass/ROSE

 

 

Section

can detect some violations of this rule

...

MITRE CWE: CWE-590, "Free of Invalid Pointer Not on the Heap"

Bibliography

Wiki Markup\[[Seacord 2005|AA. Bibliography#Seacord 05] \] Chapter 4, "Dynamic Memory Management"

...

MEM33-C. Allocate and copy structures containing flexible array members dynamically      08. Memory Management (MEM)