CodeQL library for C/C++
codeql/cpp-all 0.12.10 (changelog, source)
Search

Module Allocation

Provides an abstract class for modeling functions and expressions that allocate memory, such as the standard malloc function. To use this QL library, create one or more QL classes extending a class here with a characteristic predicate that selects the functions or expressions you are trying to model. Within that class, override the predicates provided by the abstract class to match the specifics of those functions or expressions. Finally, add a private import statement to Models.qll.

Import path

import semmle.code.cpp.models.interfaces.Allocation

Imports

Function

Provides classes for working with functions, including template functions.

Models

Classes

AllocationExpr

An allocation expression such as call to malloc or a new expression.

AllocationFunction

An allocation function such as malloc.

HeuristicAllocationExpr

An expression that might allocate memory.

HeuristicAllocationFunction

An function that might allocate memory.

OperatorNewAllocationFunction

An operator new or operator new[] function that may be associated with new or new[] expressions. Note that new and new[] are not function calls, but these functions may also be called directly.