I have a line of code:
CGFloat *components = CGColorGetComponents([color CGColor]);
and the analyzer is saying that there is a leak here.
I tried free(components) but the app crashes when I do that.
Is there really a leak here since I didnt allocate anything. I know that CGColorGetComponents returns an array of 3 CGFloat’s but when I try to free them it crashes.
Any help is appreciated.
See SO #792119.
In short, do not free your pointer.
You could, however, set it to NULL.