I am getting the following memeory leaks after running analyze tool in xcode
//Getting memeory leak warning here "Potential leak of an object allocated and stored into 'phones'
ABMultiValueRef phones = ABRecordCopyValue(ref, kABPersonPhoneProperty);
//Getting potential leak error for line below
if (ABMultiValueGetCount(ABRecordCopyValue(ref, kABPersonPhoneProperty))!=0)
{
//Getting potential leak error for line below
CFStringRef pNumber = ABMultiValueCopyValueAtIndex(phones,0);
phoneNumber = [NSString stringWithFormat:@"%@", (NSString *)pNumber];
NSString *contactFirstLast = [NSString stringWithFormat: @"%@ %@", firstName, lastName];
}
How can I resolve these leakages?