From 15eefe8ca51f28e359318df19e8fdef32938ced6 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Tue, 11 Jul 2023 15:46:48 -0500 Subject: [PATCH] Fix memory leak for H5Ovisit on files --- src/rest_vol_object.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/rest_vol_object.c b/src/rest_vol_object.c index c4dcf8f8..27cf5ead 100644 --- a/src/rest_vol_object.c +++ b/src/rest_vol_object.c @@ -809,6 +809,7 @@ RV_object_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_s /* This is a copy of the file, not a reference to the same memory */ loc_obj->domain->u.file.ref_count--; + iter_object->u.file.ref_count = 1; iter_object_type = H5I_FILE; break; case H5I_GROUP: @@ -958,8 +959,6 @@ RV_object_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_s object_iter_data.iter_obj_parent->URI) < 0) FUNC_GOTO_ERROR(H5E_LINK, H5E_SYSERRSTR, FAIL, "snprintf error"); - // (!strcmp(object_type_header, "groups")) ? "/links" : "") - if (url_len >= URL_MAX_LENGTH) FUNC_GOTO_ERROR(H5E_LINK, H5E_SYSERRSTR, FAIL, "H5Oiterate/visit request URL size exceeded maximum URL size"); @@ -1006,13 +1005,6 @@ RV_object_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_s /* Unlike H5Lvisit, H5Ovisit executes the provided callback on the directly specified object. */ - /* Why FOBP? We can just make a request to the URI with whatever fields we want directly. */ - /* - if (RV_find_object_by_path(object_iter_data.iter_obj_parent, ".", &iter_object_type, - RV_get_object_info_callback, NULL, &oinfo) < 0) - FUNC_GOTO_ERROR(H5E_OBJECT, H5E_PARSEERROR, FAIL, "failed to get object info"); - */ - /* Make GET request to server */ /* Setup the host header */