diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 20:25:52 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 20:25:52 (GMT) |
commit | b7d9ed39c22b616c7da48323c03531e122670ebc (patch) | |
tree | c4da22bc5b562346666f561afcfc385bdcf7fd42 /test/fheap.c | |
parent | ada561507a68ad41b71c0d891974e6f7a97fa2a8 (diff) | |
download | hdf5-b7d9ed39c22b616c7da48323c03531e122670ebc.zip hdf5-b7d9ed39c22b616c7da48323c03531e122670ebc.tar.gz hdf5-b7d9ed39c22b616c7da48323c03531e122670ebc.tar.bz2 |
[svn-r22112] Description:
Minor code safety issue in test/fheap.c and whitespace in other files.
Tested on:
Mac OSX/64 10.7.3 (amazon) w/debug
(Too minor to require h5committest)
Diffstat (limited to 'test/fheap.c')
-rw-r--r-- | test/fheap.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/fheap.c b/test/fheap.c index 2cb8796..14cfbe8 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -415,13 +415,20 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off, if(keep_ids) { /* Check for needing to increase size of heap ID array */ if(keep_ids->num_ids + 1 > keep_ids->alloc_ids) { + unsigned char *tmp_ids; + size_t *tmp_lens; + size_t *tmp_offs; + keep_ids->alloc_ids = MAX(1024, (keep_ids->alloc_ids * 2)); - if(NULL == (keep_ids->ids = (unsigned char *)H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids))) + if(NULL == (tmp_ids = (unsigned char *)H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids))) TEST_ERROR - if(NULL == (keep_ids->lens = (size_t *)H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids))) + keep_ids->ids = tmp_ids; + if(NULL == (tmp_lens = (size_t *)H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids))) TEST_ERROR - if(NULL == (keep_ids->offs = (size_t *)H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids))) + keep_ids->lens = tmp_lens; + if(NULL == (tmp_offs = (size_t *)H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids))) TEST_ERROR + keep_ids->offs = tmp_offs; } /* end if */ /* Append the object info onto the array */ |