diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2011-03-18 20:13:16 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2011-03-18 20:13:16 (GMT) |
commit | f845e716bc34a5929e979cf046ab3d032c7e21d8 (patch) | |
tree | cc20ed94dc7b3d8e207480cded5a88ee52086fa5 | |
parent | d697acbfb588b0406403109398105e12562e2d3e (diff) | |
download | hdf5-f845e716bc34a5929e979cf046ab3d032c7e21d8.zip hdf5-f845e716bc34a5929e979cf046ab3d032c7e21d8.tar.gz hdf5-f845e716bc34a5929e979cf046ab3d032c7e21d8.tar.bz2 |
[svn-r20274] Purpose:
Fixed Bug 2214 - GMQS: h5diff - memory leak in diff()
Description:
Memory leaks occurred when accessing symbolic links with --follow-symlink
option.
Test cases are in testing script. (400 - 456, 501 - 518)
An example test : valgrind --leak-check=full h5diff --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5
Tested:
jam (linux32-LE), amani (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Cmake - jam
-rw-r--r-- | release_docs/RELEASE.txt | 2 | ||||
-rw-r--r-- | tools/lib/h5diff.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6b1e0e7..98c1f34 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -506,6 +506,8 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - Fixed memory leak for h5diff when accessing symbolic links with + --follow-symlink option. Bug#2214 (JKM 2011/3/18) - Fixed memory leak for h5diff when access variable length string data. Bug#2216 (JKM 2011/3/18) - Fixed and improved help page for -a option of h5ls. diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 5f406cf..a616dba 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1958,9 +1958,6 @@ hsize_t diff(hid_t file1_id, if(options->m_verbose) print_found(nfound); - /* free link info buffer */ - HDfree(linkinfo1.trg_path); - HDfree(linkinfo2.trg_path); } break; @@ -2007,10 +2004,6 @@ hsize_t diff(hid_t file1_id, file2_id, path2, options, linkinfo1.trg_type); } - - /* free link info buffer */ - HDfree(linkinfo1.trg_path); - HDfree(linkinfo2.trg_path); } /* end if */ else { @@ -2045,6 +2038,12 @@ hsize_t diff(hid_t file1_id, break; } + /* free link info buffer */ + if (linkinfo1.trg_path) + HDfree(linkinfo1.trg_path); + if (linkinfo2.trg_path) + HDfree(linkinfo2.trg_path); + return nfound; out: |