summaryrefslogtreecommitdiffstats
path: root/src/H5Aint.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 /src/H5Aint.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 'src/H5Aint.c')
-rw-r--r--src/H5Aint.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/H5Aint.c b/src/H5Aint.c
index ba30506..101d604 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -1149,8 +1149,8 @@ H5A_dense_copy_file_cb(const H5A_t *attr_src, void *_udata)
HDassert(udata->file);
HDassert(udata->cpy_info);
- if ( NULL == (attr_dst=H5A_attr_copy_file(attr_src, udata->file,
- udata->recompute_size, udata->cpy_info, udata->dxpl_id)))
+ if(NULL == (attr_dst = H5A_attr_copy_file(attr_src, udata->file,
+ udata->recompute_size, udata->cpy_info, udata->dxpl_id)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute")
/* Reset shared location information */
@@ -1168,10 +1168,8 @@ H5A_dense_copy_file_cb(const H5A_t *attr_src, void *_udata)
H5_END_TAG(H5_ITER_ERROR);
done:
- if(attr_dst) {
- (void)H5A_free(attr_dst);
- attr_dst = H5FL_FREE(H5A_t, attr_dst);
- } /* end if */
+ if(attr_dst && H5A_close(attr_dst) < 0)
+ HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close destination attribute")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5A_dense_copy_file_cb() */