forked from OSchip/llvm-project
19 lines
548 B
C
19 lines
548 B
C
// RUN: clang -checker-cfref -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();
|
|
CGColorSpaceRetain(X); // expected-warning{{leak}}
|
|
}
|
|
|
|
void fb() {
|
|
CGColorSpaceRef X = CGColorSpaceCreateDeviceRGB();
|
|
CGColorSpaceRetain(X);
|
|
CGColorSpaceRelease(X);
|
|
CGColorSpaceRelease(X); // no-warning
|
|
}
|