diff options
author | David Young <dyoung@hdfgroup.org> | 2020-05-09 00:31:32 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-09 00:31:32 (GMT) |
commit | a69c33af13578b0935419adb5a1ec89563123e52 (patch) | |
tree | 9c799fac9b48baccbaeed20d5c55ef995609c66c | |
parent | b7c05d2231c4266773b9be487766712e09295e4b (diff) | |
download | hdf5-a69c33af13578b0935419adb5a1ec89563123e52.zip hdf5-a69c33af13578b0935419adb5a1ec89563123e52.tar.gz hdf5-a69c33af13578b0935419adb5a1ec89563123e52.tar.bz2 |
Take care not to leak property lists or data spaces.
-rw-r--r-- | test/vfd_swmr_bigset_writer.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c index 21c13db..c150a27 100644 --- a/test/vfd_swmr_bigset_writer.c +++ b/test/vfd_swmr_bigset_writer.c @@ -237,6 +237,9 @@ create_extensible_dset(state_t *s, unsigned int which) ds = H5Dcreate2(s->file, dname, H5T_STD_U32BE, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if (H5Pclose(dcpl) < 0) + errx(EXIT_FAILURE, "H5Pclose(dcpl)"); + if (H5Sclose(filespace) < 0) errx(EXIT_FAILURE, "H5Sclose failed"); @@ -282,6 +285,11 @@ open_extensible_dset(state_t *s, unsigned int which) if (H5Sget_simple_extent_dims(filespace, dims, maxdims) < 0) errx(EXIT_FAILURE, "H5Sget_simple_extent_dims failed"); + if (H5Sclose(filespace) < 0) + errx(EXIT_FAILURE, "H5Sclose failed"); + + filespace = badhid; + if (s->two_dee) { if (maxdims[0] != two_dee_max_dims[0] || maxdims[1] != two_dee_max_dims[1] || @@ -297,11 +305,6 @@ open_extensible_dset(state_t *s, unsigned int which) maxdims[0], maxdims[1], dims[1]); } - if (H5Sclose(filespace) < 0) - errx(EXIT_FAILURE, "H5Sclose failed"); - - filespace = badhid; - s->dataset[which] = ds; } @@ -416,7 +419,7 @@ verify_extensible_dset(state_t *s, unsigned int which, uint32_t mat[ROWS][COLS], nrows = (unsigned)(size[0] / original_dims[0]); if (nrows < 2) - return; + goto out; last_step = nrows - 2; @@ -457,10 +460,11 @@ verify_extensible_dset(state_t *s, unsigned int which, uint32_t mat[ROWS][COLS], } } + *stepp = last_step; + +out: if (H5Sclose(filespace) < 0) errx(EXIT_FAILURE, "H5Sclose failed"); - - *stepp = last_step; } static void |