summaryrefslogtreecommitdiffstats
path: root/src/H5Ochunk.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-04-22 13:20:21 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-04-22 13:20:21 (GMT)
commit7f08e6b1d93e06640f4353df32b28b4982aee260 (patch)
treef91408dc8041eb353c7479f99d89d69f1f6b0adc /src/H5Ochunk.c
parentfd9ed5d743dd862cb0575464dfc4fa6dd5983d22 (diff)
downloadhdf5-7f08e6b1d93e06640f4353df32b28b4982aee260.zip
hdf5-7f08e6b1d93e06640f4353df32b28b4982aee260.tar.gz
hdf5-7f08e6b1d93e06640f4353df32b28b4982aee260.tar.bz2
[svn-r18609] Description:
Bring r18608 from trunk to 1.8 branch: Simplify object header allocation routines, and clean up some compiler warnings. Tested on: FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode (h5committested on trunk)
Diffstat (limited to 'src/H5Ochunk.c')
-rw-r--r--src/H5Ochunk.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c
index 03865fb..f1668f7 100644
--- a/src/H5Ochunk.c
+++ b/src/H5Ochunk.c
@@ -113,16 +113,20 @@ H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
chk_proxy->oh = oh;
chk_proxy->chunkno = idx;
+ /* Increment reference count on object header */
+ if(H5O_inc_rc(oh) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "can't increment reference count on object header")
+
/* Insert the chunk proxy into the cache */
if(H5AC_set(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header chunk")
chk_proxy = NULL;
- /* Increment reference count on object header */
- if(H5O_inc_rc(oh) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "can't increment reference count on object header")
-
done:
+ if(ret_value < 0)
+ if(chk_proxy)
+ chk_proxy = H5FL_FREE(H5O_chunk_proxy_t, chk_proxy);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_chunk_add() */