8230861: missing ReleaseStringUTFChars in Java_sun_security_pkcs11_wrapper_PKCS11_connect
Reviewed-by: alanb, stuefe
--- a/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c Wed Sep 11 18:31:25 2019 -0700
+++ b/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c Wed Sep 11 16:54:53 2019 +0200
@@ -109,6 +109,7 @@
exceptionMessage = (char *) malloc(sizeof(char) * (strlen(systemErrorMessage) + strlen(libraryNameStr) + 1));
if (exceptionMessage == NULL) {
throwOutOfMemoryError(env, 0);
+ (*env)->ReleaseStringUTFChars(env, jPkcs11ModulePath, libraryNameStr);
return;
}
strcpy(exceptionMessage, systemErrorMessage);