diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2013-09-05 20:44:14 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2013-09-05 20:44:14 (GMT) |
commit | 5b876c929f79003c85585570827452f5d8052d01 (patch) | |
tree | 89a1fa7bb8221a8679f180868467464e331c18ce /tools/h5jam | |
parent | a1fe10691cf7ce1737aa420191efb996f7fe5657 (diff) | |
download | hdf5-5b876c929f79003c85585570827452f5d8052d01.zip hdf5-5b876c929f79003c85585570827452f5d8052d01.tar.gz hdf5-5b876c929f79003c85585570827452f5d8052d01.tar.bz2 |
[svn-r24101] Description:
Clean up warnings, enable new compiler warning flag(s) and bring back
changes from Coverity branch:
r20813:
Remove the dead code as listed for coverity bug #1722. h5committested.
r20814:
Issue 69: Check return value and throw error if negative return. Also free datatype id on error
r20815:
Use HDstrncpy. --gh
r20816:
Replaced one last HDstrcat call with HDstrncat to resolve coverity issue 832.
r20817:
Use HDstrncpy and HDstrncat. --gh
r20818:
Purpose: Fix valgrind issues with h5jam
Description:
Modified h5jam to free strings strdup'd in parse_command_line before exit. Note
that they may still not be freed in case of error, due to the widespread use of
exit().
r20819:
Issue 80: change loop to use int as loop index.
r20820:
Maintenance: Fixed the bug found by coverity CID 788
There were two problems with this function:
1) it tried to unnecessary free NULL pointer
2) it tried to allocate c_name buffer that is done by H5Pget_class_name
Tested on:
Mac OSX 10.8.4 (amazon) w/gcc 4.8.1, C++ & FORTRAN
(too minor to require h5committest)
Diffstat (limited to 'tools/h5jam')
-rw-r--r-- | tools/h5jam/h5jam.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index 52eb0aa..ab38f65 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -327,7 +327,7 @@ main (int argc, const char *argv[]) leave (EXIT_FAILURE); } - h5fsize = sbuf2.st_size; + h5fsize = (hsize_t)sbuf2.st_size; if (output_file == NULL) { ofid = HDopen (input_file, O_WRONLY, 0); @@ -385,16 +385,19 @@ main (int argc, const char *argv[]) /* pad the ub */ where = write_pad (ofid, where); - if (ub_file) + if(ub_file) HDfree (ub_file); - if (input_file) + if(input_file) HDfree (input_file); - if (output_file) + if(output_file) HDfree (output_file); - if (ufid >= 0) HDclose (ufid); - if (h5fid >= 0) HDclose (h5fid); - if (ofid >= 0) HDclose (ofid); + if(ufid >= 0) + HDclose (ufid); + if(h5fid >= 0) + HDclose (h5fid); + if(ofid >= 0) + HDclose (ofid); return h5tools_getstatus(); } |