From 2b982cf2fed43ed5e332521a21caa0cd55cf3e96 Mon Sep 17 00:00:00 2001 From: Matt L <124107509+mattjala@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:08:16 -0500 Subject: [PATCH] Fix bad connector ID management during file open fallback (#5429) --- src/H5VLcallback.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index 71ad2035565..7d34d351f41 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -3750,7 +3750,6 @@ H5VL__file_open_find_connector_cb(H5PL_type_t H5_ATTR_UNUSED plugin_type, H5P_genplist_t *fapl_plist_copy; herr_t status; bool is_accessible = false; /* Whether file is accessible */ - hid_t connector_id = H5I_INVALID_HID; hid_t fapl_id = H5I_INVALID_HID; herr_t ret_value = H5_ITER_CONT; @@ -3797,13 +3796,14 @@ H5VL__file_open_find_connector_cb(H5PL_type_t H5_ATTR_UNUSED plugin_type, } done: - if (connector && H5I_dec_app_ref(connector_id) < 0) - HDONE_ERROR(H5E_ID, H5E_CANTCLOSEOBJ, H5_ITER_ERROR, "can't close VOL connector ID"); - - if (ret_value != H5_ITER_STOP) + if (ret_value != H5_ITER_STOP) { if (fapl_id >= 0 && H5I_dec_app_ref(fapl_id) < 0) HDONE_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, H5_ITER_ERROR, "can't close fapl"); + if (connector && H5VL_conn_dec_rc(connector) < 0) + HDONE_ERROR(H5E_ID, H5E_CANTCLOSEOBJ, H5_ITER_ERROR, "can't close VOL connector"); + } + FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__file_open_find_connector_cb() */