diff options
author | David Young <dyoung@hdfgroup.org> | 2020-07-10 21:16:01 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-07-10 21:16:01 (GMT) |
commit | 0c98fe96e5221dae69d6317e050150ea7b592ba2 (patch) | |
tree | e1c77054c700b48f4f831f693ec5f038241fcb26 /test | |
parent | 09b17b6563f6ae3b5ed96369a93ee503b43b04cf (diff) | |
download | hdf5-0c98fe96e5221dae69d6317e050150ea7b592ba2.zip hdf5-0c98fe96e5221dae69d6317e050150ea7b592ba2.tar.gz hdf5-0c98fe96e5221dae69d6317e050150ea7b592ba2.tar.bz2 |
Don't leak a fapl on error.
Diffstat (limited to 'test')
-rw-r--r-- | test/vfd_swmr.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c index 2e66dc7..f7d9ede 100644 --- a/test/vfd_swmr.c +++ b/test/vfd_swmr.c @@ -88,18 +88,19 @@ init_vfd_swmr_config_fapl(H5F_vfd_swmr_config_t *config, uint32_t tick_len, uint /* Create a copy of the file access property list */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto done; + return H5I_INVALID_HID; - if(H5Pset_vfd_swmr_config(fapl, config) < 0) - goto done; + if(H5Pset_vfd_swmr_config(fapl, config) < 0) { + (void)H5Pclose(fapl); + return H5I_INVALID_HID; + } /* Enable page buffering */ - if(pbuf_size != 0) { - if(H5Pset_page_buffer_size(fapl, pbuf_size, 0, 0) < 0) - goto done; + if(pbuf_size != 0 && H5Pset_page_buffer_size(fapl, pbuf_size, 0, 0) < 0) { + (void)H5Pclose(fapl); + return H5I_INVALID_HID; } -done: return fapl; } /* init_vfd_swmr_config_fapl() */ |