summaryrefslogtreecommitdiffstats
path: root/src/H5FD.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-31 00:47:30 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-01-31 00:47:30 (GMT)
commit10301154215fb6a22590e80f7b5ed0005f3e1786 (patch)
tree7e93ed62e81d85176085e788b91eed79664a5a43 /src/H5FD.c
parent88b4c915e88681557e23702c571b458763a294b2 (diff)
downloadhdf5-10301154215fb6a22590e80f7b5ed0005f3e1786.zip
hdf5-10301154215fb6a22590e80f7b5ed0005f3e1786.tar.gz
hdf5-10301154215fb6a22590e80f7b5ed0005f3e1786.tar.bz2
Minor refactoring to the VFD info free call.
Diffstat (limited to 'src/H5FD.c')
-rw-r--r--src/H5FD.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 7788f58..63112bd 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -581,7 +581,7 @@ H5FD_free_driver_info(hid_t driver_id, const void *driver_info)
FUNC_ENTER_NOAPI(FAIL)
- if(driver_id > 0) {
+ if(driver_id > 0 && driver_info) {
H5FD_class_t *driver;
/* Retrieve the driver for the ID */
@@ -589,16 +589,14 @@ H5FD_free_driver_info(hid_t driver_id, const void *driver_info)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID")
/* Allow driver to free info or do it ourselves */
- if(driver_info) {
- if(driver->fapl_free) {
- /* Free the const pointer */
- /* Cast through uintptr_t to de-const memory */
- if((driver->fapl_free)((void *)(uintptr_t)driver_info) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed")
- }
- else
- driver_info = H5MM_xfree_const(driver_info);
+ if(driver->fapl_free) {
+ /* Free the const pointer */
+ /* Cast through uintptr_t to de-const memory */
+ if((driver->fapl_free)((void *)(uintptr_t)driver_info) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed")
}
+ else
+ driver_info = H5MM_xfree_const(driver_info);
}
done: