SecItemCopyMatching을 사용할 경우 CFDictionaryRef 의 내용을 CFTypeRef으로 검색하는 구문을 사용시

CFTypeRef가 메모리가 할당된 뒤 해제를 시켜주어야 한다.

그때 CFRelease를 사용하여 해제를 시켜주어야 한다.

예 :

if (SecItemCopyMatching((CFDictionaryRef)genericPasswordQuery, (CFTypeRef *)&attributes) == noErr) {
.......
}

......
CFRelease(attributes);

+ Recent posts