1 // RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=osx.SecKeychainAPI -analyzer-output=text -verify %s
3 // This file is for testing enhanced diagnostics produced by the default SecKeychainAPI checker.
5 typedef unsigned int OSStatus;
6 typedef unsigned int SecKeychainAttributeList;
7 typedef unsigned int SecKeychainItemRef;
8 typedef unsigned int SecItemClass;
9 typedef unsigned int UInt32;
14 OSStatus SecKeychainItemCopyContent (
15 SecKeychainItemRef itemRef,
16 SecItemClass *itemClass,
17 SecKeychainAttributeList *attrList,
22 void DellocWithCFStringCreate4(void) {
23 unsigned int *ptr = 0;
28 st = SecKeychainItemCopyContent(2, ptr, ptr, &length, (void **)&bytes); // expected-note {{Data is allocated here}}
30 if (st == noErr) // expected-note {{Assuming 'st' is equal to noErr}} // expected-note{{Taking true branch}}
33 length++; // expected-warning {{Allocated data is not released}} // expected-note{{Allocated data is not released}}