CodeQL library for C/C++
Search

Module NewDelete

Provides predicates for associating new/malloc calls with delete/free.

Import path

import Critical.NewDelete

Imports

DataFlow

Provides a library for local (intra-procedural) and global (inter-procedural) data flow analysis: deciding whether data can flow from a source to a sink.

SSA

Provides classes and predicates for SSA representation (Static Single Assignment form).

cpp

Provides classes and predicates for working with C/C++ code.

Predicates

allocExpr

Holds if alloc is a use of malloc or new. kind is a string describing the type of the allocation.

allocExprOrIndirect

Holds if alloc is a use of malloc or new, or a function wrapping one of those. kind is a string describing the type of the allocation.

allocReaches

Holds if e is an expression which may evaluate to the result of previous memory allocations alloc only of type kind.

freeExpr

Holds if free is a use of free or delete. freed is the expression that is freed / deleted and kind is a string describing the type of that free or delete.

freeExprOrIndirect

Holds if free is a use of free or delete, or a function wrapping one of those. freed is the expression that is freed / deleted and kind is a string describing the type of that free or delete.