summaryrefslogtreecommitdiffstats
path: root/src/H5Pdxpl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Pdxpl.c')
-rw-r--r--src/H5Pdxpl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 046b046..5f83a1d 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -2281,7 +2281,7 @@ herr_t
H5Pset_dataset_io_hyperslab_selection(hid_t plist_id, unsigned rank, H5S_seloper_t op, const hsize_t start[],
const hsize_t stride[], const hsize_t count[], const hsize_t block[])
{
- H5P_genplist_t *plist; /* Property list pointer */
+ H5P_genplist_t *plist = NULL; /* Property list pointer */
H5S_t * space; /* Dataspace to hold selection */
hbool_t space_created = FALSE; /* Whether a new dataspace has been created */
hbool_t reset_prop_on_error = FALSE; /* Whether to reset the property on failure */
@@ -2371,7 +2371,7 @@ H5Pset_dataset_io_hyperslab_selection(hid_t plist_id, unsigned rank, H5S_seloper
done:
/* Cleanup on failure */
if (ret_value < 0) {
- if (reset_prop_on_error && H5P_poke(plist, H5D_XFER_DSET_IO_SEL_NAME, &space) < 0)
+ if (reset_prop_on_error && plist && H5P_poke(plist, H5D_XFER_DSET_IO_SEL_NAME, &space) < 0)
HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "error setting dataset I/O selection")
if (space_created && H5S_close(space) < 0)
HDONE_ERROR(H5E_PLIST, H5E_CLOSEERROR, FAIL, "unable to release dataspace")