Hello, please review this small  change to  unix  
Java_sun_security_pkcs11_wrapper_PKCS11_connect .
Here we miss a call to ReleaseStringUTFChars  before early returns , e.g.  
these early returns .


127     // with the old JAR file jGetFunctionList is null, temporarily check 
for that
128     if (jGetFunctionList != NULL) {
129         getFunctionListStr = (*env)->GetStringUTFChars(env, 
jGetFunctionList, 0);
130         if (getFunctionListStr == NULL) {
131             return;
132         }
 ...
 135     }
136     if (C_GetFunctionList == NULL) {
137         throwIOException(env, "ERROR: C_GetFunctionList == NULL");
138         return;
139     } else if ( (systemErrorMessage = dlerror()) != NULL ){
140         throwIOException(env, systemErrorMessage);
141         return;
142     }

Fix is to move the last call to (*env)->ReleaseStringUTFChars(env, 
jPkcs11ModulePath, libraryNameStr);
Some lines  forward in the function  
Java_sun_security_pkcs11_wrapper_PKCS11_connect .


Bug/webrev :

https://bugs.openjdk.java.net/browse/JDK-8239457

http://cr.openjdk.java.net/~mbaesken/webrevs/8239457.0/


Thanks, Matthias

Reply via email to