diff options
author | neal <neal> | 2008-02-15 15:48:19 +0000 |
---|---|---|
committer | neal <neal> | 2008-02-15 15:48:19 +0000 |
commit | 1ac36aab83d5ab5f89f6a06f67499c540faf4fb0 (patch) | |
tree | 0e94d57d6d09ce057b10334209024b39a4fd5ce5 /libhurd-mm/anonymous.c | |
parent | 08ebd8b7d06d2dda73fa3c4b6177f249366f8a46 (diff) |
libhurd-btree/
2008-02-15 Neal H. Walfield <neal@gnu.org>
* btree.h (BTREE_(insert)) [!NDEBUG]: Assert that the node
pointers are clear.
* btree.c (BTREE_(detach)) [!NDEBUG]: Clear ROOT.
* btree-test.c (main): Clear allocated nodes.
libhurd-mm/
2008-02-15 Neal H. Walfield <neal@gnu.org>
* anonymous.c (destroy) [!NDEBUG]: Clear NODE before freeing it.
Diffstat (limited to 'libhurd-mm/anonymous.c')
-rw-r--r-- | libhurd-mm/anonymous.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libhurd-mm/anonymous.c b/libhurd-mm/anonymous.c index d8dc68c..5b85ce6 100644 --- a/libhurd-mm/anonymous.c +++ b/libhurd-mm/anonymous.c @@ -202,6 +202,12 @@ destroy (struct pager *pager) next = hurd_btree_storage_desc_next (node); storage_free (node->storage, false); + +#ifndef NDEBUG + /* When reallocating, we expect that the node field is 0. + libhurd-btree asserts this, so make it so. */ + memset (node, 0, sizeof (struct storage_desc)); +#endif storage_desc_free (node); } |