summaryrefslogtreecommitdiffstats
path: root/src/H5Ocopy.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-08-09 01:02:02 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-08-09 01:02:02 (GMT)
commit4e6b652c3d0fdd94fc7f2aa588ab63cea7bcde64 (patch)
tree067a2194a69b6f5334310528b1650c131971c861 /src/H5Ocopy.c
parent98ac51ba1c4b73081ab0a3091f3cca703426b593 (diff)
downloadhdf5-4e6b652c3d0fdd94fc7f2aa588ab63cea7bcde64.zip
hdf5-4e6b652c3d0fdd94fc7f2aa588ab63cea7bcde64.tar.gz
hdf5-4e6b652c3d0fdd94fc7f2aa588ab63cea7bcde64.tar.bz2
[svn-r22647] Description:
Bring r22646 from trunk to 1.8 branch: Changes resulting from Klocwork static analysis tool, from Mark Miller @ LLNL (miller86@llnl.gov). Tested on: Mac OS X/64 10.7.4 (amazon) w/debug, C++ & FORTRAN, using gcc 4.7.x (too minor to require h5committest)
Diffstat (limited to 'src/H5Ocopy.c')
-rw-r--r--src/H5Ocopy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 8df062b..bc71948 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -1056,11 +1056,15 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
FUNC_ENTER_NOAPI_NOINIT
+ /* Sanity check */
HDassert(oloc_src);
HDassert(oloc_src->file);
HDassert(H5F_addr_defined(oloc_src->addr));
HDassert(oloc_dst->file);
+ /* Intialize copy info before errors can be thrown */
+ HDmemset(&cpy_info, 0, sizeof(H5O_copy_t));
+
/* Get the copy property list */
if(NULL == (ocpy_plist = (H5P_genplist_t *)H5I_object(ocpypl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
@@ -1078,7 +1082,6 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get callback info")
/* Convert copy flags into copy struct */
- HDmemset(&cpy_info, 0, sizeof(H5O_copy_t));
if((cpy_option & H5O_COPY_SHALLOW_HIERARCHY_FLAG) > 0) {
cpy_info.copy_shallow = TRUE;
cpy_info.max_depth = 1;