summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_attr.c
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-03-18 18:50:19 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-03-18 18:50:19 (GMT)
commitd697acbfb588b0406403109398105e12562e2d3e (patch)
tree8aa04d2c07a43ae2d75eea54938dc16318d444a0 /tools/lib/h5diff_attr.c
parente038bf6eb718711c76a86074848e96a8158a12bd (diff)
downloadhdf5-d697acbfb588b0406403109398105e12562e2d3e.zip
hdf5-d697acbfb588b0406403109398105e12562e2d3e.tar.gz
hdf5-d697acbfb588b0406403109398105e12562e2d3e.tar.bz2
[svn-r20270] Purpose:
Improve the previous fix for Bug 2216 - GMQS: h5diff - memory leak when compares vlen string in dataset or attributes Description: Improve the fix along with the previous checkin r20266. Add a new function to tool lib, h5tools_detect_vlen_data() which return TRUE if include any kind of vlen data all at once, either VLEN-data or VLEN-string and so on. Also updated h5ls and h5dump code accordingly. Tested: jam (linux32-LE), amani (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Cmake - jam
Diffstat (limited to 'tools/lib/h5diff_attr.c')
-rw-r--r--tools/lib/h5diff_attr.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 1742028..01fa896 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -223,14 +223,12 @@ hsize_t diff_attr(hid_t loc1_id,
/* Free buf1 and buf2, check both VLEN-data VLEN-string to reclaim any
* VLEN memory first */
- if(TRUE == H5Tdetect_class(mtype1_id, H5T_VLEN) ||
- TRUE == h5tools_detect_vlen_str(mtype1_id))
+ if(TRUE == h5tools_detect_vlen_data(mtype1_id))
H5Dvlen_reclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1);
HDfree(buf1);
buf1 = NULL;
- if(TRUE == H5Tdetect_class(mtype2_id, H5T_VLEN) ||
- TRUE == h5tools_detect_vlen_str(mtype2_id))
+ if(TRUE == h5tools_detect_vlen_data(mtype2_id))
H5Dvlen_reclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2);
HDfree(buf2);
buf2 = NULL;
@@ -260,14 +258,12 @@ hsize_t diff_attr(hid_t loc1_id,
error:
H5E_BEGIN_TRY {
if(buf1) {
- if(TRUE == H5Tdetect_class(mtype1_id, H5T_VLEN) ||
- TRUE == h5tools_detect_vlen_str(mtype1_id))
+ if(TRUE == h5tools_detect_vlen_data(mtype1_id))
H5Dvlen_reclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1);
HDfree(buf1);
} /* end if */
if(buf2) {
- if(TRUE == H5Tdetect_class(mtype2_id, H5T_VLEN) ||
- TRUE == h5tools_detect_vlen_str(mtype2_id))
+ if(TRUE == h5tools_detect_vlen_data(mtype2_id))
H5Dvlen_reclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2);
HDfree(buf2);
} /* end if */