blob: 38f0512b006321a5245856b57b83798d0991e96b [file] [log] [blame]
// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s
typedef struct CGColorSpace *CGColorSpaceRef;
extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
extern CGColorSpaceRef CGColorSpaceRetain(CGColorSpaceRef space);
extern void CGColorSpaceRelease(CGColorSpaceRef space);
void f() {
CGColorSpaceRef X = CGColorSpaceCreateDeviceRGB(); // expected-warning{{leak}}
CGColorSpaceRetain(X);
}
void fb() {
CGColorSpaceRef X = CGColorSpaceCreateDeviceRGB();
CGColorSpaceRetain(X);
CGColorSpaceRelease(X);
CGColorSpaceRelease(X); // no-warning
}