summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-03-04 21:19:34 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-03-04 21:19:34 (GMT)
commit0bd98ecc77ad50a65f43395f383838d7a68071fe (patch)
treeff678fa3d83a3b7c9b82d0c9c2d2b982fa4dd0c6
parenta090a0efa9147a741ec5628f7def7685a2148b81 (diff)
downloadhdf5-0bd98ecc77ad50a65f43395f383838d7a68071fe.zip
hdf5-0bd98ecc77ad50a65f43395f383838d7a68071fe.tar.gz
hdf5-0bd98ecc77ad50a65f43395f383838d7a68071fe.tar.bz2
[svn-r10146] Purpose:
Bug fix Description: Add some "safety net" sort of assertions and sanity checks contributed by user. Platforms tested: FreeBSD 4.11 (sleipnir) Too minor to require h5committest
-rw-r--r--src/H5B.c1
-rw-r--r--src/H5Distore.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/H5B.c b/src/H5B.c
index 9e36002..e53ec86 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -531,6 +531,7 @@ H5B_dest(H5F_t UNUSED *f, H5B_t *bt)
* Check arguments.
*/
assert(bt);
+ assert(bt->rc_shared);
H5FL_SEQ_FREE(haddr_t,bt->child);
H5FL_BLK_FREE(native_block,bt->native);
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 9b75ca4..dfb1214 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -1252,6 +1252,8 @@ H5D_istore_dest (H5D_t *dset, hid_t dxpl_id)
HDmemset (rdcc, 0, sizeof(H5D_rdcc_t));
/* Free the raw B-tree node buffer */
+ if(dset->shared->layout.u.chunk.btree_shared==NULL)
+ HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil")
if(H5RC_DEC(dset->shared->layout.u.chunk.btree_shared)<0)
HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")
@@ -3232,6 +3234,8 @@ H5D_istore_delete(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout)
HGOTO_ERROR(H5E_IO, H5E_CANTDELETE, 0, "unable to delete chunk B-tree")
/* Free the raw B-tree node buffer */
+ if(tmp_layout.u.chunk.btree_shared==NULL)
+ HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil")
if(H5RC_DEC(tmp_layout.u.chunk.btree_shared)<0)
HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")
} /* end if */
@@ -3484,6 +3488,8 @@ H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int inden
(void)H5B_debug (f, dxpl_id, addr, stream, indent, fwidth, H5B_ISTORE, &udata);
/* Free the raw B-tree node buffer */
+ if(layout.u.chunk.btree_shared==NULL)
+ HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil")
if(H5RC_DEC(layout.u.chunk.btree_shared)<0)
HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")