Copilot commented on code in PR #4398:
URL: https://github.com/apache/arrow-adbc/pull/4398#discussion_r3410754512
##########
java/driver/jni/src/main/cpp/jni_wrapper.cc:
##########
@@ -337,6 +337,7 @@
Java_org_apache_arrow_adbc_driver_jni_impl_NativeAdbc_openDatabase(
error_guard.error);
const jsize num_params = env->GetArrayLength(parameters);
+ if (env->ExceptionCheck()) return nullptr;
Review Comment:
These early returns on pending JNI exceptions can leak native resources
allocated by `AdbcDatabaseNew` (driver manager allocates a `TempDatabase` in
`database->private_data`) because `db` is a plain `unique_ptr` with no custom
deleter. Before returning `nullptr` here, release the database so the pre-init
state is freed and the pending Java exception can propagate without leaving
native allocations behind.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]