8303576: addIdentitiesToKeystore in KeystoreImpl.m needs CFRelease call in early potential CHECK_NULL return

Reviewed-by: weijun
This commit is contained in:
Matthias Baesken 2023-03-09 08:36:24 +00:00
parent dd79410824
commit a7e308ab6e

View File

@ -285,9 +285,14 @@ static void addIdentitiesToKeystore(JNIEnv *env, jobject keyStore)
OSErr searchResult = noErr;
jclass jc_KeychainStore = (*env)->FindClass(env, "apple/security/KeychainStore");
CHECK_NULL(jc_KeychainStore);
if (jc_KeychainStore == NULL) {
goto errOut;
}
jmethodID jm_createKeyEntry = (*env)->GetMethodID(env, jc_KeychainStore, "createKeyEntry", "(Ljava/lang/String;JJ[J[[B)V");
CHECK_NULL(jm_createKeyEntry);
if (jm_createKeyEntry == NULL) {
goto errOut;
}
do {
searchResult = SecIdentitySearchCopyNext(identitySearch, &theIdentity);