forked from OSchip/llvm-project
Add a test that shows that reporting a leak after failure to free is
tricky. llvm-svn: 167814
This commit is contained in:
parent
67291b90f9
commit
de13814a37
|
@ -245,9 +245,12 @@ void test12365078_no_malloc(unichar *characters) {
|
|||
if (!string) {free(characters);}
|
||||
}
|
||||
|
||||
void test12365078_false_negative_no_malloc(unichar *characters) {
|
||||
NSString *test12365078_no_malloc_returnValue(unichar *characters) {
|
||||
NSString *string = [[NSString alloc] initWithCharactersNoCopy:characters length:12 freeWhenDone:1];
|
||||
if (!string) {;}
|
||||
if (!string) {
|
||||
return 0; // no-warning
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
void test12365078_nocheck_nomalloc(unichar *characters) {
|
||||
|
|
Loading…
Reference in New Issue