HomePhabricator

[analyzer] Teach MismatchedDealloc about initWithBytesNoCopy with deallocator.

Authored by dergachev.a on Dec 18 2019, 1:19 PM.

Description

[analyzer] Teach MismatchedDealloc about initWithBytesNoCopy with deallocator.

MallocChecker warns when memory is passed into -[NSData initWithBytesNoCopy]
but isn't allocated by malloc(), because it will be deallocated by free().
However, initWithBytesNoCopy has an overload that takes an arbitrary block
for deallocating the object. If such overload is used, it is no longer
necessary to make sure that the memory is allocated by malloc().

Details

Committed
dergachev.aDec 18 2019, 2:19 PM
Parents
rG997bc8b2e6b9: Add prototype for a function we call.
Branches
Unknown
Tags
Unknown