This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 27da207e2ee [fix](jni-connector) avoid core dump if init connector
failed (#34007) (#34329)
27da207e2ee is described below
commit 27da207e2eec0b7153e880e27d939216701a9b1e
Author: Mingyu Chen <[email protected]>
AuthorDate: Tue Apr 30 12:31:06 2024 +0800
[fix](jni-connector) avoid core dump if init connector failed (#34007)
(#34329)
bp #34007
---
be/src/vec/exec/jni_connector.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/exec/jni_connector.cpp
b/be/src/vec/exec/jni_connector.cpp
index 7ad6761523d..218bd260455 100644
--- a/be/src/vec/exec/jni_connector.cpp
+++ b/be/src/vec/exec/jni_connector.cpp
@@ -192,7 +192,10 @@ Status JniConnector::close() {
env->CallVoidMethod(_jni_scanner_obj, _jni_scanner_close);
env->DeleteGlobalRef(_jni_scanner_obj);
}
- env->DeleteGlobalRef(_jni_scanner_cls);
+ if (_jni_scanner_cls != nullptr) {
+ // _jni_scanner_cls may be null if init connector failed
+ env->DeleteGlobalRef(_jni_scanner_cls);
+ }
_closed = true;
jthrowable exc = (env)->ExceptionOccurred();
if (exc != nullptr) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]