diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-15 03:05:59 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-15 03:05:59 (GMT) |
commit | 066294e32131d1d81d326d35d67b0d753e8b8b56 (patch) | |
tree | ff8ac3f4d94edceeacf167486a8a9f7adcd01d63 /src/H5Olink.c | |
parent | 22da4232a4693e3f0a4ee2f37053f85a28e885fd (diff) | |
download | hdf5-066294e32131d1d81d326d35d67b0d753e8b8b56.zip hdf5-066294e32131d1d81d326d35d67b0d753e8b8b56.tar.gz hdf5-066294e32131d1d81d326d35d67b0d753e8b8b56.tar.bz2 |
[svn-r18109] Description:
Bring r18076-18096 from hdf5_1_8_coverity branch to trunk:
r18076:
Correct Coverity issue #1 by removing dead code
r18077:
Fix coverity item 142. When an error occurred while copying a linked list in
H5S_point_copy, the library would not free the partially allocated list. Added
code to free the list in this case.
r18078:
Correct Coverity issue #2 by removing impossible to reach code.
r18079:
Correct #3 by removing impossible to reach code.
r18080:
Correct Coverity issue #4 by removing impossible to reach code.
r18081:
fix coverity 26 , check (dblik->parent) before calls H5HF_man_iblock_detach().
r18082:
Fixed coverity issues 321 and 316.
321: freed sm_buf in error handling to remove resource leak.
Also set sm_buf to NULL after other instances in which
it is freed to prevent double free.
316: initialized nmembs to 0.
r18083:
Correct Coverity issue #6 by removing debugging knob from error reporting code.
r18084:
Fix coverity item 269 + others. When a error occurred in a function using the
h5tools error framework, the "past_catch" variable would not be set to true
because that statement was before the label that goto jumped to. This could
cause a failure in the cleanup section to go back to the start of the section,
freeing variables twice, etc.
Moved the label infront of past_catch=TRUE.
r18085:
fixed coverity #27, check if (heap) before use heap->obj....
r18086:
fixed coverity #28, check curr_span not null before use it at if(curr_span &&
(io_bytes_left==0 || curr_seq>=maxseq))
r18087:
Correct Coverity issue #7 by cleaning up correctly on error
r18088:
Correct Coverity #8 by removing unchanged variable checking code.
r18089:
Correct Coverity issue #9 - remove impossible to reach code.
r18090:
Correct Coverity issue #11 by removing impossible to reach code. Also clean
up some minor style issues.
r18091:
Fix coverity items 314 and 318. Changed the improper assertion of the return
value of a library function to a check, and a return(void) on failure.
r18092:
Fix coverity item 70. Changed the improper assertion of the return value of a
library function to a check, and a return(void) on failure.
r18093:
Correct Coverity issue #12 by removing dead code.
r18094:
Correct Coverity issue #16 by removing debugging code.
r18095:
Fixed coverity issue # 271.
Removed redundant checking and freeing of sm_buf1 and sm_buf2.
r18096:
Correct Coverity issue #17 by refactoring test to remove dead code.
Also, removed previous "coverity" statements in comments, we'll review
those issues again and see if we can figure them out, now that we have more
experience with Coverity.
Tested on:
Mac OS X/32 10.6.2 (amazon)
Diffstat (limited to 'src/H5Olink.c')
-rw-r--r-- | src/H5Olink.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/H5Olink.c b/src/H5Olink.c index ffe80e7..4ddfbf6 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -705,7 +705,6 @@ H5O_link_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t UNUSED *file_ hid_t UNUSED dxpl_id) { H5O_link_t *link_src = (H5O_link_t *)native_src; - H5O_link_t *link_dst = NULL; void *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_link_copy_file) @@ -721,17 +720,10 @@ H5O_link_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t UNUSED *file_ /* Allocate "blank" link for destination */ /* (values will be filled in during 'post copy' operation) */ - if(NULL == (link_dst = H5FL_CALLOC(H5O_link_t))) + if(NULL == (ret_value = H5FL_CALLOC(H5O_link_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* Set return value */ - ret_value = link_dst; - done: - if(!ret_value) - if(link_dst) - H5O_link_free(link_dst); - FUNC_LEAVE_NOAPI(ret_value) } /* H5O_link_copy_file() */ |