I am manipulating an image with the following method and there is a memory leak at first line. The code is not ARC so I have to manually release the memory. How can I release the memory leaked in the first line of the following function?
-(UIImage*) manipulateImage :(UIImage *)image :(int)intType
{
CIImage* inputImage = [[[CIImage alloc] initWithImage:image] autorelease]; //leak is here.
CIFilter* filter = [CIFilter filterWithName:@"CIColorControls"];
[filter setValue:inputImage forKey:kCIInputImageKey];
[filter setValue:@(intType) forKey:kCIInputSaturationKey];
CIImage* result = [filter valueForKey:kCIOutputImageKey];
CIImage* returnImage = [result imageByCroppingToRect:[result extent]];
return [[[UIImage alloc] initWithCGImage:returnImage.CGImage] autorelease];
}