summaryrefslogtreecommitdiffstats
path: root/test/dtypes.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-08-09 01:02:02 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-08-09 01:02:02 (GMT)
commit4e6b652c3d0fdd94fc7f2aa588ab63cea7bcde64 (patch)
tree067a2194a69b6f5334310528b1650c131971c861 /test/dtypes.c
parent98ac51ba1c4b73081ab0a3091f3cca703426b593 (diff)
downloadhdf5-4e6b652c3d0fdd94fc7f2aa588ab63cea7bcde64.zip
hdf5-4e6b652c3d0fdd94fc7f2aa588ab63cea7bcde64.tar.gz
hdf5-4e6b652c3d0fdd94fc7f2aa588ab63cea7bcde64.tar.bz2
[svn-r22647] Description:
Bring r22646 from trunk to 1.8 branch: 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 'test/dtypes.c')
-rw-r--r--test/dtypes.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index 17349b9..dca7eec 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -1127,10 +1127,8 @@ test_compound_5(void)
}
/* Free memory buffers */
- if(buf)
- HDfree(buf);
- if(bkg)
- HDfree(bkg);
+ HDfree(buf);
+ HDfree(bkg);
return retval;
}
@@ -4699,11 +4697,12 @@ test_bitfield_funcs(void)
{
hid_t type=-1, ntype=-1, super=-1;
int size;
- char* tag;
+ char* tag=0;
H5T_pad_t inpad;
H5T_cset_t cset;
H5T_str_t strpad;
herr_t ret;
+ int retval=-1;
TESTING("some type functions for bitfield");
@@ -4787,16 +4786,18 @@ test_bitfield_funcs(void)
goto error;
} /* end if */
- H5Tclose(type);
- H5Tclose(ntype);
- PASSED();
- reset_hdf5();
- return 0;
+ retval = 0;
error:
+
+ if (retval == -1) retval = 1;
+
+ HDfree(tag);
+ H5Tclose(ntype);
H5Tclose(type);
+ if (retval == 0) PASSED();
reset_hdf5();
- return 1;
+ return retval;
}
@@ -7050,11 +7051,13 @@ error:
*/
int test_utf_ascii_conv(void)
{
- hid_t fid;
- hid_t did;
- hid_t utf8_vtid, ascii_vtid;
- hid_t utf8_tid, ascii_tid;
- hid_t sid;
+ hid_t fid = -1;
+ hid_t did = -1;
+ hid_t utf8_vtid = -1;
+ hid_t ascii_vtid = -1;
+ hid_t utf8_tid = -1;
+ hid_t ascii_tid = -1;
+ hid_t sid = -1;
const char *utf8_w = "foo!";
char *ascii_r = NULL;
const char *ascii_w = "bar!";