@@ -476,6 +476,9 @@ cplusplus.NewDelete (C++)
476476"""""""""""""""""""""""""
477477Check for double-free and use-after-free problems. Traces memory managed by new/delete.
478478
479+ Custom allocation/deallocation functions can be defined using
480+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
481+
479482.. literalinclude :: checkers/newdelete_example.cpp
480483 :language: cpp
481484
@@ -485,6 +488,9 @@ cplusplus.NewDeleteLeaks (C++)
485488""""""""""""""""""""""""""""""
486489Check for memory leaks. Traces memory managed by new/delete.
487490
491+ Custom allocation/deallocation functions can be defined using
492+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
493+
488494.. code-block :: cpp
489495
490496 void test() {
@@ -1263,6 +1269,9 @@ You can silence this warning either by bound checking the ``size`` parameter, or
12631269by explicitly marking the ``size `` parameter as sanitized. See the
12641270:ref: `optin-taint-GenericTaint ` checker for an example.
12651271
1272+ Custom allocation/deallocation functions can be defined using
1273+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
1274+
12661275.. code-block :: c
12671276
12681277 void vulnerable(void) {
@@ -1857,6 +1866,9 @@ unix.Malloc (C)
18571866"""""""""""""""
18581867Check for memory leaks, double free, and use-after-free problems. Traces memory managed by malloc ()/free ().
18591868
1869+ Custom allocation/deallocation functions can be defined using
1870+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
1871+
18601872.. literalinclude :: checkers/unix_malloc_example.c
18611873 :language: c
18621874
@@ -1866,6 +1878,9 @@ unix.MallocSizeof (C)
18661878"""""""""""""""""""""
18671879Check for dubious ``malloc `` arguments involving ``sizeof ``.
18681880
1881+ Custom allocation/deallocation functions can be defined using
1882+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
1883+
18691884.. code-block :: c
18701885
18711886 void test() {
@@ -1881,6 +1896,9 @@ unix.MismatchedDeallocator (C, C++)
18811896"""""""""""""""""""""""""""""""""""
18821897Check for mismatched deallocators.
18831898
1899+ Custom allocation/deallocation functions can be defined using
1900+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
1901+
18841902.. literalinclude :: checkers/mismatched_deallocator_example.cpp
18851903 :language: c
18861904
0 commit comments