summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-31 00:31:11 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:31:54 (GMT)
commitaacc6038044160c694b54c9fff816f7583160423 (patch)
treedf7ca6891097b5941dcaefaadfce9123f68517c0 /src/H5Pfapl.c
parent5e76dccbe0f874e352813b5d24a6b84c80b59fcd (diff)
downloadhdf5-aacc6038044160c694b54c9fff816f7583160423.zip
hdf5-aacc6038044160c694b54c9fff816f7583160423.tar.gz
hdf5-aacc6038044160c694b54c9fff816f7583160423.tar.bz2
Updated the 'const memory free' changes based on PR feedback.
Diffstat (limited to 'src/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 4bde238..16f1e0e 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1162,7 +1162,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-H5_GCC_DIAG_OFF(cast-qual)
static herr_t
H5P__file_driver_free(void *value)
{
@@ -1175,22 +1174,11 @@ H5P__file_driver_free(void *value)
/* Copy the driver & info, if there is one */
if(info->driver_id > 0) {
- if(info->driver_info) {
- H5FD_class_t *driver; /* Pointer to driver */
- /* Retrieve the driver for the ID */
- if(NULL == (driver = (H5FD_class_t *)H5I_object(info->driver_id)))
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a driver ID")
-
- /* Allow driver to free info or do it ourselves */
- if(driver->fapl_free) {
- /* Free the const pointer (why we turn off the diagnostic) */
- if((driver->fapl_free)((void *)info->driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "driver info free request failed")
- }
- else
- H5MM_xfree_const(info->driver_info);
- }
+ /* Free the driver info, if it exists */
+ if(info->driver_info)
+ if(H5FD_free_driver_info(info->driver_id, info->driver_info) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "driver info free request failed")
/* Decrement reference count for driver */
if(H5I_dec_ref(info->driver_id) < 0)
@@ -1201,7 +1189,6 @@ H5P__file_driver_free(void *value)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__file_driver_free() */
-H5_GCC_DIAG_ON(cast-qual)
/*-------------------------------------------------------------------------