Commit fb084fdf authored by gsell's avatar gsell

memory leaks in H5Port core functions fixed

parent be7cd1d4
...@@ -254,5 +254,6 @@ h5u_write_dataset ( ...@@ -254,5 +254,6 @@ h5u_write_dataset (
hid_t dset_id; hid_t dset_id;
TRY (dset_id = h5u_open_dataset (fh, name, type)); TRY (dset_id = h5u_open_dataset (fh, name, type));
TRY (h5u_write (fh, dset_id, type, data)); TRY (h5u_write (fh, dset_id, type, data));
TRY (hdf5_close_dataset(dset_id));
H5_RETURN (H5_SUCCESS); H5_RETURN (H5_SUCCESS);
} }
...@@ -152,6 +152,8 @@ h5u_set_num_items ( ...@@ -152,6 +152,8 @@ h5u_set_num_items (
TRY (hdf5_close_dataspace (u->shape)); TRY (hdf5_close_dataspace (u->shape));
u->shape = H5S_ALL; u->shape = H5S_ALL;
TRY (hdf5_close_dataspace (u->memshape));
u->memshape = H5S_ALL;
u->nparticles = (hsize_t)nparticles; u->nparticles = (hsize_t)nparticles;
...@@ -212,7 +214,8 @@ h5u_set_num_items ( ...@@ -212,7 +214,8 @@ h5u_set_num_items (
TRY( u->shape = hdf5_create_dataspace(1, &count, NULL) ); TRY( u->shape = hdf5_create_dataspace(1, &count, NULL) );
/* declare overall data size but then will select a subset */ /* declare overall data size but then will select a subset */
TRY( u->diskshape = hdf5_create_dataspace(1, &count, NULL) ); TRY (hdf5_close_dataspace (u->diskshape));
TRY (u->diskshape = hdf5_create_dataspace(1, &count, NULL));
count = nparticles; count = nparticles;
if (count > 0) { if (count > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment