8212216: JGSS: Fix leak in exception cases in getJavaOID()
Reviewed-by: mullan, weijun
This commit is contained in:
parent
e6d66056ab
commit
10027304cd
@ -724,17 +724,14 @@ jobject getJavaOID(JNIEnv *env, gss_OID cOid) {
|
||||
if (jbytes == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
(*env)->SetByteArrayRegion(env, jbytes, 0, 2, (jbyte *) oidHdr);
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
return NULL;
|
||||
if (!(*env)->ExceptionCheck(env)) {
|
||||
(*env)->SetByteArrayRegion(env, jbytes, 0, 2, (jbyte *) oidHdr);
|
||||
}
|
||||
(*env)->SetByteArrayRegion(env, jbytes, 2, cLen, (jbyte *) cOid->elements);
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
return NULL;
|
||||
if (!(*env)->ExceptionCheck(env)) {
|
||||
(*env)->SetByteArrayRegion(env, jbytes, 2, cLen, (jbyte *) cOid->elements);
|
||||
}
|
||||
result = (*env)->NewObject(env, CLS_Oid, MID_Oid_ctor1, jbytes);
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
return NULL;
|
||||
if (!(*env)->ExceptionCheck(env)) {
|
||||
result = (*env)->NewObject(env, CLS_Oid, MID_Oid_ctor1, jbytes);
|
||||
}
|
||||
(*env)->DeleteLocalRef(env, jbytes);
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user