mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8310549: avoid potential leaks in KeystoreImpl.m related to JNU_CHECK_EXCEPTION early returns
Reviewed-by: weijun
This commit is contained in:
parent
8e047029e8
commit
7da3f1999f
1 changed files with 6 additions and 2 deletions
|
@ -363,7 +363,9 @@ static void addIdentitiesToKeystore(JNIEnv *env, jobject keyStore)
|
|||
// Call back to the Java object to create Java objects corresponding to this security object.
|
||||
jlong nativeKeyRef = ptr_to_jlong(privateKeyRef);
|
||||
(*env)->CallVoidMethod(env, keyStore, jm_createKeyEntry, alias, creationDate, nativeKeyRef, certRefArray, javaCertArray);
|
||||
JNU_CHECK_EXCEPTION(env);
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
goto errOut;
|
||||
}
|
||||
}
|
||||
} while (searchResult == noErr);
|
||||
|
||||
|
@ -505,7 +507,9 @@ static void addCertificatesToKeystore(JNIEnv *env, jobject keyStore)
|
|||
// Call back to the Java object to create Java objects corresponding to this security object.
|
||||
jlong nativeRef = ptr_to_jlong(certRef);
|
||||
(*env)->CallVoidMethod(env, keyStore, jm_createTrustedCertEntry, alias, inputTrust, nativeRef, creationDate, certData);
|
||||
JNU_CHECK_EXCEPTION(env);
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
goto errOut;
|
||||
}
|
||||
}
|
||||
} while (searchResult == noErr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue