[PATCH][Review request] unix.Malloc checker improvement: +handling new/delete, +memory.MismatchedFree, +memory.MismatchedDelete, +improved display names for allocators/deallocators

Jordan Rose jordan_rose at apple.com
Fri Apr 5 09:15:30 PDT 2013


On Apr 4, 2013, at 18:59 , Anton Yartsev <anton.yartsev at gmail.com> wrote:

> void test12365078_nocheck_nomalloc(unichar *characters) {
>   NSString *string = [[NSString alloc] initWithCharactersNoCopy:characters length:12 freeWhenDone:1];
>   free(characters); // expected-warning {{Attempt to free non-owned memory}}
> }

Hm, no, this warning is correct. Perhaps the "non-owned" warning is really dependent on the deallocator, not the region being freed.

(This is the second or third time I've forgotten this case. Thanks for being patient with me.)

Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130405/3515aab9/attachment.html>


More information about the cfe-commits mailing list