A variable of raw pointer type is initialized with new, so the code has to remember to delete it
What it finds
A raw pointer that owns what new made needs a delete on every path, exceptions included. A std::unique_ptr or a container frees the object by itself. Placement new is left alone.
From the rule's source, owning_raw_pointer.rs.
Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/cpp:owning-raw-pointer" = "note"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/cpp:owning-raw-pointer] reason="..."tx0 explain tx0/cpp:owning-raw-pointer shows the same in the terminal. Found a false positive? Report it.