diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-01-31 00:47:30 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:31:54 (GMT) |
commit | 1311f9e999b3be7d12e936af735dd5fc3b11b08d (patch) | |
tree | a5568ef353d4b8581f5948751b603abd9c049035 /src | |
parent | aacc6038044160c694b54c9fff816f7583160423 (diff) | |
download | hdf5-1311f9e999b3be7d12e936af735dd5fc3b11b08d.zip hdf5-1311f9e999b3be7d12e936af735dd5fc3b11b08d.tar.gz hdf5-1311f9e999b3be7d12e936af735dd5fc3b11b08d.tar.bz2 |
Minor refactoring to the VFD info free call.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FD.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -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: |