summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-31 00:31:11 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-01-31 00:31:11 (GMT)
commit88b4c915e88681557e23702c571b458763a294b2 (patch)
tree65195b2c6ee9c29fe0eaab1807d0c43b6ca56997 /src/H5Pfapl.c
parent9da387342eea566659daed83c850220cee041059 (diff)
downloadhdf5-88b4c915e88681557e23702c571b458763a294b2.zip
hdf5-88b4c915e88681557e23702c571b458763a294b2.tar.gz
hdf5-88b4c915e88681557e23702c571b458763a294b2.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 f238466..9a04c3e 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1146,7 +1146,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-H5_GCC_DIAG_OFF(cast-qual)
static herr_t
H5P__file_driver_free(void *value)
{
@@ -1159,22 +1158,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)
@@ -1185,7 +1173,6 @@ H5P__file_driver_free(void *value)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__file_driver_free() */
-H5_GCC_DIAG_ON(cast-qual)
/*-------------------------------------------------------------------------