summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index e0cbe62..5a5c8c9 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1187,12 +1187,14 @@ H5P__file_driver_free(void *value)
/* Allow driver to free info or do it ourselves */
if (driver->fapl_free) {
- if ((driver->fapl_free)((void *)info->driver_info) < 0) /* Casting away const OK -QAK */
+ /* Free the const pointer */
+ /* Cast through uintptr_t to de-const memory */
+ if ((driver->fapl_free)((void *)(uintptr_t)info->driver_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "driver info free request failed")
} /* end if */
else
- H5MM_xfree((void *)info->driver_info); /* Casting away const OK -QAK */
- } /* end if */
+ H5MM_xfree_const(info->driver_info);
+ } /* end if */
/* Decrement reference count for driver */
if (H5I_dec_ref(info->driver_id) < 0)