From c22f43651c7b98c69da6b5421857169b5b63458e Mon Sep 17 00:00:00 2001 From: Alexey Belkevich Date: Wed, 26 Feb 2014 22:59:27 +0200 Subject: [PATCH] Fixed bad access of phone label string FIxed memory leak of peoples array --- Classes/APAddressBook.m | 1 + Classes/APContact.m | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/APAddressBook.m b/Classes/APAddressBook.m index 8a4f504..4842186 100644 --- a/Classes/APAddressBook.m +++ b/Classes/APAddressBook.m @@ -88,6 +88,7 @@ - (void)loadContacts:(void (^)(NSArray *contacts, NSError *error))callbackBlock } [contacts sortUsingDescriptors:descriptors]; array = contacts.copy; + CFRelease(peopleArrayRef); } else if (errorRef) { diff --git a/Classes/APContact.m b/Classes/APContact.m index ca72d1a..06ece58 100644 --- a/Classes/APContact.m +++ b/Classes/APContact.m @@ -116,7 +116,6 @@ - (NSString *)localizedLabelFromMultiValue:(ABMultiValueRef)multiValue index:(NS if (localizedLabel) { label = (__bridge_transfer NSString *)localizedLabel; - CFRelease(localizedLabel); } CFRelease(rawLabel); }