Donát Nagy 13b362911e
[analyzer] Suppress NewDeleteLeaks FP in protobuf code (#162124)
Code automatically generated by protobuf can include a pattern where it
allocates memory with `new` and then passes it to a function named
`GetOwnedMessageInternal` which takes ownership of the allocated memory.
This caused large amounts of false positives on a system where the
protobuf header was included as a system header and therefore the
analyzer assumed that `GetOwnedMessageInternal` won't escape memory.

As we already individually recognize a dozen functions that can be
declared in system headers but can escape memory, this commit just adds
`GetOwnedMessageInternal` to that list.

On a longer term perhaps we should distinguish the standard library
headers (where the analyzer can assume that it recognizes all the
functions that can free/escape memory) and other system headers (where
the analyzer shouldn't make this assumption).
2025-10-07 14:48:31 +02:00
..