Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/178#discussion_r45232529
--- Diff: core/sql/executor/HBaseClient_JNI.cpp ---
@@ -2856,26 +2861,25 @@ HBC_RetCode
HBaseClient_JNI::getHbaseTableInfo(const char* tblName,
tsRecentJMFromJNI = JavaMethods_[JM_GET_HBTI].jm_full_name;
jboolean jresult = jenv_->CallBooleanMethod(javaObj_,
JavaMethods_[JM_GET_HBTI].methodID,
js_tblName, jHtabInfo);
- jboolean isCopy;
- jint* arrayElems = jenv_->GetIntArrayElements(jHtabInfo, &isCopy);
- indexLevels = arrayElems[0];
- blockSize = arrayElems[1];
- if (isCopy == JNI_TRUE)
- jenv_->ReleaseIntArrayElements(jHtabInfo, arrayElems, JNI_ABORT);
-
- jenv_->DeleteLocalRef(js_tblName);
-
if (jenv_->ExceptionCheck())
{
getExceptionDetails();
logError(CAT_SQL_HBASE, __FILE__, __LINE__);
logError(CAT_SQL_HBASE, "HBaseClient_JNI::getHbaseTableInfo()",
getLastError());
+ jenv_->PopLocalFrame(NULL);
return HBC_ERROR_GET_HBTI_EXCEPTION;
}
+ jboolean isCopy;
+ jint* arrayElems = jenv_->GetIntArrayElements(jHtabInfo, &isCopy);
+ indexLevels = arrayElems[0];
+ blockSize = arrayElems[1];
+ if (isCopy == JNI_TRUE)
+ jenv_->ReleaseIntArrayElements(jHtabInfo, arrayElems, JNI_ABORT);
if (jresult == false)
{
logError(CAT_SQL_HBASE, "HBaseClient_JNI::getHbaseTableInfo()",
getLastError());
+ jenv_->PopLocalFrame(NULL);
return HBC_ERROR_GET_HBTI_EXCEPTION;
}
--- End diff --
Should do it. Will submit a change because it can cause memory leak.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---