Commit b072a159 authored by John Esmet's avatar John Esmet

Really fix the test helper memory leak this time

parent 2b5e4f01
...@@ -133,6 +133,9 @@ int toku_testsetup_leaf(FT_HANDLE ft_handle, BLOCKNUM *blocknum, int n_children, ...@@ -133,6 +133,9 @@ int toku_testsetup_leaf(FT_HANDLE ft_handle, BLOCKNUM *blocknum, int n_children,
toku_memdup_dbt(&pivotkeys[i], keys[i], keylens[i]); toku_memdup_dbt(&pivotkeys[i], keys[i], keylens[i]);
} }
node->pivotkeys.create_from_dbts(pivotkeys, n_children - 1); node->pivotkeys.create_from_dbts(pivotkeys, n_children - 1);
for (int i = 0; i + 1 < n_children; i++) {
toku_destroy_dbt(&pivotkeys[i]);
}
toku_free(pivotkeys); toku_free(pivotkeys);
*blocknum = node->blocknum; *blocknum = node->blocknum;
...@@ -154,6 +157,11 @@ int toku_testsetup_nonleaf (FT_HANDLE ft_handle, int height, BLOCKNUM *blocknum, ...@@ -154,6 +157,11 @@ int toku_testsetup_nonleaf (FT_HANDLE ft_handle, int height, BLOCKNUM *blocknum,
toku_memdup_dbt(&pivotkeys[i], keys[i], keylens[i]); toku_memdup_dbt(&pivotkeys[i], keys[i], keylens[i]);
} }
node->pivotkeys.create_from_dbts(pivotkeys, n_children - 1); node->pivotkeys.create_from_dbts(pivotkeys, n_children - 1);
for (int i = 0; i + 1 < n_children; i++) {
toku_destroy_dbt(&pivotkeys[i]);
}
toku_free(pivotkeys);
*blocknum = node->blocknum; *blocknum = node->blocknum;
toku_unpin_ftnode(ft_handle->ft, node); toku_unpin_ftnode(ft_handle->ft, node);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment