diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-02-20 02:23:44 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-02-20 02:23:44 (GMT) |
commit | 0c39a78927ae1e4b7471f96743a8cf5dd30350b0 (patch) | |
tree | 21eb68c066d6ef8a139278439d02c89202ce970f /src/H5Dchunk.c | |
parent | 7bac0bb48dd18809fa015e91848dc8756c0fe536 (diff) | |
download | hdf5-0c39a78927ae1e4b7471f96743a8cf5dd30350b0.zip hdf5-0c39a78927ae1e4b7471f96743a8cf5dd30350b0.tar.gz hdf5-0c39a78927ae1e4b7471f96743a8cf5dd30350b0.tar.bz2 |
[svn-r18300] Description:
Bring Coverity fixes from branch to trunk:
r18282:
Fix Coverity issue #428 by wrapping testing calls with if(pass) {} block.
r18283:
Fix Coverity issue #425 by wrapping test calls in if(pass) {} block
r18284:
Issue 166: init_error() malloc'd 3 pointers in initialization and never freed
inc ase of errors. Init pointers to NULL, check allocation results and free
allocations in error block
r18285:
Fix Coverity issue #410 by wrapping test calls with if(pass) {} block.
r18286:
Issue 165: custom_print_cb() needed allocations freed in error block.
r18287:
Fix coverity issue # 409
Added if (pass) checks around calls to flush_cache. Additionally,
added a check for file_ptr = NULL after call to setup_cache.
r18288:
Fix coverity# 107 free fh in H5HF_close() correctly before exit the function
even when failure occurs.
r18289:
Fix Coverity issue #429: correct failure return values to match return type
from routine.
r18290:
Fix Coverity issue #103: release allocated indirect section on error
r18294:
Issue 153, 152: Check allocations and free allocations in error block. Also
cleaned up hid_t identifer that were opened in error block.
r18295:
Fix coverity# 101 free new_loc in H5HF_man_iter_start_entry() correctly before
exit the function even when failure occurs
r18296:
Fix coverity# 100 free down_loc in H5HF_man_iter_down() before exit the function
when failure occurs
r18297:
Fixed coverity issues 54, 55 and 216. Correctly handle the various ways that
allocation of attr_name can fail in test_attr_basic_write.
r18298:
Fix coverity# 119 free object in H5HG_read() before exit the function when
failure occurs
r18299:
Fix coverity issue #112:
Add cleanup during error handling of H5MP_create.
Tested on:
Mac OS X/32 10.6.2 (amazon) w/debug & production
Misc. Linux configurations (on original checkins)
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r-- | src/H5Dchunk.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index ba4f795..e77f580 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -3421,7 +3421,7 @@ H5D_chunk_prune_fill(const H5D_chunk_rec_t *chunk_rec, H5D_chunk_it_ud1_t *udata /* Calculate the index of this chunk */ if(H5V_chunk_index(rank, chunk_rec->offset, layout->u.chunk.dim, layout->u.chunk.down_chunks, &io_info->store->chunk.index) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5_ITER_ERROR, "can't get chunk index") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") /* Lock the chunk into the cache, to get a pointer to the chunk buffer */ /* (Casting away const OK -QAK) */ @@ -3780,7 +3780,7 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dims) if(needs_fill) { /* Allocate space for the stack node */ if(NULL == (tmp_stack = H5FL_MALLOC(H5D_chunk_prune_stack_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for stack node") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for stack node") /* Set up chunk record for fill routine */ tmp_stack->rec.nbytes = dset->shared->layout.u.chunk.size; @@ -3800,7 +3800,7 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dims) while(tmp_stack) { /* Write the fill value */ if(H5D_chunk_prune_fill(&(tmp_stack->rec), &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write fill value") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write fill value") /* Advance the stack pointer */ tmp_stack = tmp_stack->next; @@ -3821,7 +3821,7 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dims) /* Remove the chunk from disk */ if((layout->storage.u.chunk.ops->remove)(&idx_info, &idx_udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, H5_ITER_ERROR, "unable to remove chunk entry from index") + HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to remove chunk entry from index") /* Advance the stack pointer */ tmp_stack = tmp_stack->next; @@ -4157,7 +4157,7 @@ H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) else if((H5T_get_class(udata->dt_src, FALSE) == H5T_REFERENCE) && (udata->file_src != udata->idx_info_dst->f)) fix_ref = TRUE; else - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy dataset elements") + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy dataset elements") } /* end if */ /* Check for filtered chunks */ @@ -4241,7 +4241,7 @@ H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Copy the reference elements */ if(H5O_copy_expand_ref(udata->file_src, buf, udata->idx_info_dst->dxpl_id, udata->idx_info_dst->f, bkg, ref_count, H5T_get_ref_type(udata->dt_src), udata->cpy_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy reference attribute") + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy reference attribute") } /* end if */ /* After fix ref, copy the new reference elements to the buffer to write out */ @@ -4263,7 +4263,7 @@ H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ if(nbytes > ((size_t)0xffffffff)) - HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") #endif /* H5_SIZEOF_SIZE_T > 4 */ H5_ASSIGN_OVERFLOW(udata_dst.nbytes, nbytes, size_t, uint32_t); udata->buf = buf; @@ -4272,7 +4272,7 @@ H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Insert chunk into the destination index */ if((udata->idx_info_dst->storage->ops->insert)(udata->idx_info_dst, &udata_dst) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk into index") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert chunk into index") /* Write chunk data to destination file */ HDassert(H5F_addr_defined(udata_dst.addr)); |