summaryrefslogtreecommitdiffstats
path: root/test/dtypes.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-08-20 21:37:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-08-20 21:37:12 (GMT)
commit47c3bc7540869f53f0b734c68d3289835f0a546d (patch)
tree90e688dc21b095d9d3d36e944465ac79eff05348 /test/dtypes.c
parentb2012d9f74843ec87b31b7aca0c3ad8b6b6fe448 (diff)
downloadhdf5-47c3bc7540869f53f0b734c68d3289835f0a546d.zip
hdf5-47c3bc7540869f53f0b734c68d3289835f0a546d.tar.gz
hdf5-47c3bc7540869f53f0b734c68d3289835f0a546d.tar.bz2
[svn-r19272] Description:
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: Mac OS X/32 10.6.4 (amazon) w/debug & valgrind (h5committest forthcoming)
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 caa5ac0..f766e6e 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -2321,6 +2321,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;
@@ -5301,7 +5302,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) {
@@ -5316,6 +5317,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) {