Skip to content

Commit

Permalink
8303576: addIdentitiesToKeystore in KeystoreImpl.m needs CFRelease ca…
Browse files Browse the repository at this point in the history
…ll in early potential CHECK_NULL return

Backport-of: a7e308ab6e5dba7df790840d29fc7edbf3af2e24
  • Loading branch information
MBaesken committed Mar 22, 2023
1 parent cc170c7 commit 3b64bde
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m
Expand Up @@ -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);

Expand Down

1 comment on commit 3b64bde

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.