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

Module Deallocation

Provides an abstract class for modeling functions and expressions that deallocate memory, such as the standard free 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.Deallocation

Imports

Function

Provides classes for working with functions, including template functions.

Models

Classes

DeallocationExpr

An deallocation expression such as call to free or a delete expression.

DeallocationFunction

A deallocation function such as free.

OperatorDeleteDeallocationFunction

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