diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-08-08 23:01:20 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-08-08 23:01:20 (GMT) |
commit | 88a94bbe7ffa3c0bb7779d1b16989b385d9eadd2 (patch) | |
tree | be52b18015cf8df4af976ab5cfdc912748783b22 /tools/misc | |
parent | 79b2eb993e29cf0382db07b322fa3ca5cb00fc65 (diff) | |
download | hdf5-88a94bbe7ffa3c0bb7779d1b16989b385d9eadd2.zip hdf5-88a94bbe7ffa3c0bb7779d1b16989b385d9eadd2.tar.gz hdf5-88a94bbe7ffa3c0bb7779d1b16989b385d9eadd2.tar.bz2 |
[svn-r22646] Description:
Changes resulting from Klocwork static analysis tool, from Mark Miller
@ LLNL (miller86@llnl.gov).
Tested on:
Mac OS X/64 10.7.4 (amazon) w/debug, C++ & FORTRAN, using gcc 4.7.x
(too minor to require h5committest)
Diffstat (limited to 'tools/misc')
-rw-r--r-- | tools/misc/talign.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/misc/talign.c b/tools/misc/talign.c index 88ebaa6..b77d846 100644 --- a/tools/misc/talign.c +++ b/tools/misc/talign.c @@ -148,28 +148,31 @@ out: result = 1; mname = H5Tget_member_name(fix, 0); printf("%14s (%2d) %6s = %s\n", - mname, (int)H5Tget_member_offset(fix,0), + mname ? mname : "(null)", (int)H5Tget_member_offset(fix,0), string5, (char *)(data + H5Tget_member_offset(fix, 0))); - free(mname); + if(mname) + free(mname); fptr = (float *)(data + H5Tget_member_offset(fix, 1)); mname = H5Tget_member_name(fix, 1); printf("Data comparison:\n" "%14s (%2d) %6f = %f\n" " %6f = %f\n", - mname, (int)H5Tget_member_offset(fix,1), + mname ? mname : "(null)", (int)H5Tget_member_offset(fix,1), fok[0], fptr[0], fok[1], fptr[1]); - free(mname); + if(mname) + free(mname); fptr = (float *)(data + H5Tget_member_offset(fix, 2)); mname = H5Tget_member_name(fix, 2); printf("%14s (%2d) %6f = %f\n" " %6f = %6f\n", - mname, (int)H5Tget_member_offset(fix,2), + mname ? mname : "(null)", (int)H5Tget_member_offset(fix,2), fnok[0], fptr[0], fnok[1], fptr[1]); - free(mname); + if(mname) + free(mname); fptr = (float *)(data + H5Tget_member_offset(fix, 1)); printf("\n" |