This is an automated email from the ASF dual-hosted git repository.

wangzhen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new 3100581d86 [GLUTEN-11473][VL] Add null check for array_ when releasing 
JavaRssClient (#11474)
3100581d86 is described below

commit 3100581d869b2dafaf0f85867fc76a59c26cfb63
Author: Zhen Wang <[email protected]>
AuthorDate: Mon Jan 26 19:22:32 2026 +0800

    [GLUTEN-11473][VL] Add null check for array_ when releasing JavaRssClient 
(#11474)
---
 cpp/core/jni/JniCommon.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/cpp/core/jni/JniCommon.h b/cpp/core/jni/JniCommon.h
index fdc084fd2f..cb400e2db3 100644
--- a/cpp/core/jni/JniCommon.h
+++ b/cpp/core/jni/JniCommon.h
@@ -502,9 +502,12 @@ class JavaRssClient : public RssClient {
       return;
     }
     env->DeleteGlobalRef(javaRssShuffleWriter_);
-    jbyte* byteArray = env->GetByteArrayElements(array_, NULL);
-    env->ReleaseByteArrayElements(array_, byteArray, JNI_ABORT);
-    env->DeleteGlobalRef(array_);
+    // array_ may be nullptr when failed to allocate new byte array in 
pushPartitionData
+    if (array_ != nullptr) {
+      jbyte* byteArray = env->GetByteArrayElements(array_, NULL);
+      env->ReleaseByteArrayElements(array_, byteArray, JNI_ABORT);
+      env->DeleteGlobalRef(array_);
+    }
   }
 
   int32_t pushPartitionData(int32_t partitionId, const char* bytes, int64_t 
size) override {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to