@@ -476,6 +476,9 @@ cplusplus.NewDelete (C++)
476
476
"""""""""""""""""""""""""
477
477
Check for double-free and use-after-free problems. Traces memory managed by new/delete.
478
478
479
+ Custom allocation/deallocation functions can be defined using
480
+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
481
+
479
482
.. literalinclude :: checkers/newdelete_example.cpp
480
483
:language: cpp
481
484
@@ -485,6 +488,9 @@ cplusplus.NewDeleteLeaks (C++)
485
488
""""""""""""""""""""""""""""""
486
489
Check for memory leaks. Traces memory managed by new/delete.
487
490
491
+ Custom allocation/deallocation functions can be defined using
492
+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
493
+
488
494
.. code-block :: cpp
489
495
490
496
void test() {
@@ -1263,6 +1269,9 @@ You can silence this warning either by bound checking the ``size`` parameter, or
1263
1269
by explicitly marking the ``size `` parameter as sanitized. See the
1264
1270
:ref: `optin-taint-GenericTaint ` checker for an example.
1265
1271
1272
+ Custom allocation/deallocation functions can be defined using
1273
+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
1274
+
1266
1275
.. code-block :: c
1267
1276
1268
1277
void vulnerable(void) {
@@ -1857,6 +1866,9 @@ unix.Malloc (C)
1857
1866
"""""""""""""""
1858
1867
Check for memory leaks, double free, and use-after-free problems. Traces memory managed by malloc ()/free ().
1859
1868
1869
+ Custom allocation/deallocation functions can be defined using
1870
+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
1871
+
1860
1872
.. literalinclude :: checkers/unix_malloc_example.c
1861
1873
:language: c
1862
1874
@@ -1866,6 +1878,9 @@ unix.MallocSizeof (C)
1866
1878
"""""""""""""""""""""
1867
1879
Check for dubious ``malloc `` arguments involving ``sizeof ``.
1868
1880
1881
+ Custom allocation/deallocation functions can be defined using
1882
+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
1883
+
1869
1884
.. code-block :: c
1870
1885
1871
1886
void test() {
@@ -1881,6 +1896,9 @@ unix.MismatchedDeallocator (C, C++)
1881
1896
"""""""""""""""""""""""""""""""""""
1882
1897
Check for mismatched deallocators.
1883
1898
1899
+ Custom allocation/deallocation functions can be defined using
1900
+ :ref: `ownership attributes<analyzer-ownership-attrs> `.
1901
+
1884
1902
.. literalinclude :: checkers/mismatched_deallocator_example.cpp
1885
1903
:language: c
1886
1904
0 commit comments