summaryrefslogtreecommitdiffstats
path: root/src/H5VLcallback.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/H5VLcallback.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/H5VLcallback.c')
-rw-r--r--src/H5VLcallback.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c
index e4ebb95..5c54b5b 100644
--- a/src/H5VLcallback.c
+++ b/src/H5VLcallback.c
@@ -525,7 +525,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_free_connector_info(hid_t connector_id, void *info)
+H5VL_free_connector_info(hid_t connector_id, const void *info)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
@@ -543,12 +543,13 @@ H5VL_free_connector_info(hid_t connector_id, void *info)
if(info) {
/* Allow the connector to free info or do it ourselves */
if(cls->info_cls.free) {
- if((cls->info_cls.free)(info) < 0)
+ /* Cast through uintptr_t to de-const memory */
+ if((cls->info_cls.free)((void *)(uintptr_t)info) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "connector info free request failed")
- } /* end if */
+ }
else
- H5MM_xfree(info);
- } /* end if */
+ H5MM_xfree_const(info);
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)