# HG changeset patch # User Dan Preston # Date 1241561415 25200 # Node ID 7c7d5a0cb4d6d467d7524ef42dfc82ce7cb445f8 # Parent 5165944a89b382269493b76120e01ed9eef01c95 Fixed the leak of SecIdentityRef objects in a while loop. diff -r 5165944a89b3 -r 7c7d5a0cb4d6 BLIP/BLIPTest.m --- a/BLIP/BLIPTest.m Tue May 05 14:46:42 2009 -0700 +++ b/BLIP/BLIPTest.m Tue May 05 15:10:15 2009 -0700 @@ -50,8 +50,10 @@ SecIdentitySearchRef search; SecIdentitySearchCreate(kc, CSSM_KEYUSE_ANY, &search); SecIdentityRef identity; - while (SecIdentitySearchCopyNext(search, &identity) == noErr) + while (SecIdentitySearchCopyNext(search, &identity) == noErr) { [identities addObject: (id)identity]; + CFRelease( identity ); + } CFRelease(search); Log(@"Found %u identities -- prompting '%@'", identities.count, prompt); if (identities.count > 0) {