summaryrefslogtreecommitdiff
path: root/src/btree/bt_discard.c
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-02-19 18:59:34 -0500
committerKeith Bostic <keith@wiredtiger.com>2014-02-19 18:59:34 -0500
commit0b3c5f745dd99365d25be048fb5b6bb8c4509731 (patch)
tree8d2b8367f42313fce9f64d5dbf33604bcfbe701b /src/btree/bt_discard.c
parente4c35d5705317361f0f84d4ee9019d3641dbf101 (diff)
downloadmongo-0b3c5f745dd99365d25be048fb5b6bb8c4509731.tar.gz
We also have to free the WT_REFs originally created for the page.
Diffstat (limited to 'src/btree/bt_discard.c')
-rw-r--r--src/btree/bt_discard.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/btree/bt_discard.c b/src/btree/bt_discard.c
index 23c7f2bd199..7f65a00c49e 100644
--- a/src/btree/bt_discard.c
+++ b/src/btree/bt_discard.c
@@ -164,6 +164,15 @@ __free_page_modify(WT_SESSION_IMPL *session, WT_PAGE *page)
static void
__free_page_int(WT_SESSION_IMPL *session, WT_PAGE *page)
{
+ WT_REF *ref;
+ uint32_t i;
+
+ /* Free any memory allocated for the original set of WT_REFs. */
+ if ((ref = page->pu_intl_oindex) != NULL)
+ for (i = page->pu_intl_oentries; i > 0; ++ref, --i)
+ __wt_free_ref(session, page, ref);
+
+ /* Free any memory allocated for the child index array. */
__wt_free(session, page->pu_intl_index);
}