diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2016-01-07 19:45:20 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2016-01-07 19:45:20 (GMT) |
commit | 899f46211ad45861de969eb752086109731623cc (patch) | |
tree | ec9e76bdb1b7f00dcf7a96eecc21257b5da2a23f | |
parent | aab046ac459d47266eb67e94ff98ffd12b48836b (diff) | |
download | hdf5-899f46211ad45861de969eb752086109731623cc.zip hdf5-899f46211ad45861de969eb752086109731623cc.tar.gz hdf5-899f46211ad45861de969eb752086109731623cc.tar.bz2 |
[svn-r28840] Fix memory error in virtual dataset close.
Tested: lola-17
-rw-r--r-- | src/H5VLiod.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/H5VLiod.c b/src/H5VLiod.c index 339a930..9e1b1f9 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -3486,23 +3486,25 @@ H5VL_iod_dataset_close(void *_dset, hid_t dxpl_id, void **req) input.iod_id, g_axe_id); #endif - if(H5VL__iod_create_and_forward(H5VL_DSET_CLOSE_ID, HG_DSET_CLOSE, - (H5VL_iod_object_t *)dset, 1, - num_parents, parent_reqs, - NULL, &input, status, status, req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship dataset close"); - /* If dataset is virtual, close source datasets */ if(dset->is_virtual) { size_t i; for(i = 0; i < dset->virtual_storage.list_nused; i++) { - if(H5VL_iod_dataset_close(dset->virtual_storage.list[i].source_dset.dset, dxpl_id, req) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close source dataset") - dset->virtual_storage.list[i].source_dset.dset = NULL; + if(dset->virtual_storage.list[i].source_dset.dset) { + if(H5VL_iod_dataset_close(dset->virtual_storage.list[i].source_dset.dset, dxpl_id, req) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close source dataset") + dset->virtual_storage.list[i].source_dset.dset = NULL; + } /* end if */ } /* end for */ } /* end if */ + if(H5VL__iod_create_and_forward(H5VL_DSET_CLOSE_ID, HG_DSET_CLOSE, + (H5VL_iod_object_t *)dset, 1, + num_parents, parent_reqs, + NULL, &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship dataset close"); + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_dataset_close() */ |