diff options
Diffstat (limited to 'test/Analysis/keychainAPI.m')
-rw-r--r-- | test/Analysis/keychainAPI.m | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/Analysis/keychainAPI.m b/test/Analysis/keychainAPI.m index a98ebfdf42..c91982fef0 100644 --- a/test/Analysis/keychainAPI.m +++ b/test/Analysis/keychainAPI.m @@ -370,9 +370,18 @@ void allocAndFree1() { my_FreeParam(ptr, outData); } -void allocNoFree2() { +void consumeChar(char); + +void allocNoFree2(int x) { OSStatus st = 0; - void *outData = my_AllocateReturn(&st); // expected-warning{{Allocated data is not released:}} + void *outData = my_AllocateReturn(&st); + if (x) { + consumeChar(*(char*)outData); // expected-warning{{Allocated data is not released:}} + return; + } else { + consumeChar(*(char*)outData); + } + return; } void allocAndFree2(void *attrList) { |