8366807: JNI exception pending in Java_sun_security_pkcs11_wrapper_PKCS11_initializeLibrary of p11_general.c:106

Reviewed-by: valeriep
This commit is contained in:
Koushik Thirupattur 2026-01-15 19:05:19 +00:00 committed by Valerie Peng
parent e97fb0e207
commit 25c834a897

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@ -100,6 +100,12 @@ Java_sun_security_pkcs11_wrapper_PKCS11_initializeLibrary
#ifndef NO_CALLBACKS
if (notifyListLock == NULL) {
notifyListLock = createLockObject(env);
/* Return immediately if lock creation failed or an exception is pending. */
if (notifyListLock == NULL || (*env)->ExceptionCheck(env)) {
TRACE0("DEBUG: createLockObject failed, aborting initialization\n");
return;
}
}
#endif