summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-11-30 11:38:24 -0500
committerKeith Bostic <keith@wiredtiger.com>2014-11-30 11:38:24 -0500
commitbf6762123afb7350cb9b757048264b842dff0d47 (patch)
tree14a812fac2719cfc3ae10074c5aabf59697de7b4
parent2f8e9916988d08bf847cb802c6c550e493ba69cf (diff)
downloadmongo-bf6762123afb7350cb9b757048264b842dff0d47.tar.gz
The parent split function shouldn't free the passed-in array of WT_REFs,
the caller owns that array (and in the case of the insert spit, it wasn't allocated memory).
-rw-r--r--src/btree/rec_split.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/btree/rec_split.c b/src/btree/rec_split.c
index e28a6799e7d..5aed59ad42f 100644
--- a/src/btree/rec_split.c
+++ b/src/btree/rec_split.c
@@ -892,7 +892,6 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref, WT_REF **ref_new,
}
else
*alloc_refp++ = pindex->index[i];
- __wt_free(session, ref_new);
/*
* Update the parent page's index: this update makes the split visible
@@ -1337,6 +1336,8 @@ __wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, int exclusive)
WT_ERR(__split_parent(
session, ref, ref_new, new_entries, parent_incr, exclusive, 1));
+ __wt_free(session, ref_new);
+
/*
* The split succeeded, discard the page.
*