summaryrefslogtreecommitdiffstats
path: root/test/dtypes.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-08-20 22:22:40 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-08-20 22:22:40 (GMT)
commit0b00c26b027b2d2afd3112d24573ceb767fc8376 (patch)
tree6dfeabd5453da487c6e6473bd24c82895b4496b5 /test/dtypes.c
parent2d7c01d1eb8254c3b5d4977428edcf1c2523bd5e (diff)
downloadhdf5-0b00c26b027b2d2afd3112d24573ceb767fc8376.zip
hdf5-0b00c26b027b2d2afd3112d24573ceb767fc8376.tar.gz
hdf5-0b00c26b027b2d2afd3112d24573ceb767fc8376.tar.bz2
[svn-r19274] Description:
Bring r19272 & 19273 from trunk to 1.8 branch: Close out various resource leaks and usages of uninitialized memory that were flagged by valgrind. [There's still some more valgrind warnings, but it's better now... :-/ ] Also clean up warnings and code formatting. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Mac OS X/32 10.6.4 (amazon) in debug mode Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
Diffstat (limited to 'test/dtypes.c')
-rw-r--r--test/dtypes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index 088030c..bb6f5e4 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -2322,6 +2322,7 @@ test_compound_13(void)
TESTING("compound datatypes of boundary size with latest format");
/* Create some phony data. */
+ HDmemset(&data_out, 0, sizeof(data_out));
for(u = 0; u < COMPOUND13_ARRAY_SIZE + 1; u++)
data_out.x[u] = u;
data_out.y = 99.99;
@@ -5302,7 +5303,7 @@ test_encode(void)
goto error;
} /* end if */
- if(vlstr_buf_size>0)
+ if(vlstr_buf_size > 0)
vlstr_buf = (unsigned char*)HDcalloc((size_t)1, vlstr_buf_size);
if(H5Tencode(tid3, vlstr_buf, &vlstr_buf_size) < 0) {
@@ -5317,6 +5318,7 @@ test_encode(void)
printf("Can't decode VL string type\n");
goto error;
} /* end if */
+ free(vlstr_buf);
/* Verify that the datatype was copied exactly */
if(H5Tequal(decoded_tid3, tid3)<=0) {