Fixed the leak of SecIdentityRef objects in a while loop.
authorDan Preston <danpreston@codechemistry.com>
Tue May 05 15:10:15 2009 -0700 (2009-05-05)
changeset 377c7d5a0cb4d6
parent 36 5165944a89b3
child 38 f090fd705556
Fixed the leak of SecIdentityRef objects in a while loop.
BLIP/BLIPTest.m
     1.1 --- a/BLIP/BLIPTest.m	Tue May 05 14:46:42 2009 -0700
     1.2 +++ b/BLIP/BLIPTest.m	Tue May 05 15:10:15 2009 -0700
     1.3 @@ -50,8 +50,10 @@
     1.4      SecIdentitySearchRef search;
     1.5      SecIdentitySearchCreate(kc, CSSM_KEYUSE_ANY, &search);
     1.6      SecIdentityRef identity;
     1.7 -    while (SecIdentitySearchCopyNext(search, &identity) == noErr)
     1.8 +    while (SecIdentitySearchCopyNext(search, &identity) == noErr) {
     1.9          [identities addObject: (id)identity];
    1.10 +		CFRelease( identity );
    1.11 +	}
    1.12      CFRelease(search);
    1.13      Log(@"Found %u identities -- prompting '%@'", identities.count, prompt);
    1.14      if (identities.count > 0) {