8230861: missing ReleaseStringUTFChars in Java_sun_security_pkcs11_wrapper_PKCS11_connect

Reviewed-by: alanb, stuefe
This commit is contained in:
Matthias Baesken 2019-09-11 16:54:53 +02:00
parent 988ac4fec0
commit 2f496251ac

View File

@ -109,6 +109,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect
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);