Commit b897baa5 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:4051] fix #4051

git-svn-id: file:///svn/toku/tokudb@35707 c7de825b-a66e-492c-adef-691d508d4ae1
parent bb7272cd
...@@ -152,7 +152,7 @@ test_split_with_everything_on_the_left(void) ...@@ -152,7 +152,7 @@ test_split_with_everything_on_the_left(void)
MALLOC_N(sn.n_children - 1, sn.childkeys); MALLOC_N(sn.n_children - 1, sn.childkeys);
sn.totalchildkeylens = 0; sn.totalchildkeylens = 0;
LEAFENTRY big_element; LEAFENTRY big_element;
char *big_val; char *big_val = NULL;
for (int bn = 0; bn < sn.n_children; ++bn) { for (int bn = 0; bn < sn.n_children; ++bn) {
BP_SUBTREE_EST(&sn,bn).ndata = random() + (((long long)random())<<32); BP_SUBTREE_EST(&sn,bn).ndata = random() + (((long long)random())<<32);
BP_SUBTREE_EST(&sn,bn).nkeys = random() + (((long long)random())<<32); BP_SUBTREE_EST(&sn,bn).nkeys = random() + (((long long)random())<<32);
...@@ -212,7 +212,9 @@ test_split_with_everything_on_the_left(void) ...@@ -212,7 +212,9 @@ test_split_with_everything_on_the_left(void)
} }
toku_free(sn.bp); toku_free(sn.bp);
toku_free(sn.childkeys); toku_free(sn.childkeys);
toku_free(big_val); if (big_val) {
toku_free(big_val);
}
} }
static void static void
...@@ -244,7 +246,7 @@ test_split_on_boundary_of_last_node(void) ...@@ -244,7 +246,7 @@ test_split_on_boundary_of_last_node(void)
MALLOC_N(sn.n_children - 1, sn.childkeys); MALLOC_N(sn.n_children - 1, sn.childkeys);
sn.totalchildkeylens = 0; sn.totalchildkeylens = 0;
LEAFENTRY big_element; LEAFENTRY big_element;
char *big_val; char *big_val = NULL;
for (int bn = 0; bn < sn.n_children; ++bn) { for (int bn = 0; bn < sn.n_children; ++bn) {
BP_SUBTREE_EST(&sn,bn).ndata = random() + (((long long)random())<<32); BP_SUBTREE_EST(&sn,bn).ndata = random() + (((long long)random())<<32);
BP_SUBTREE_EST(&sn,bn).nkeys = random() + (((long long)random())<<32); BP_SUBTREE_EST(&sn,bn).nkeys = random() + (((long long)random())<<32);
...@@ -304,7 +306,9 @@ test_split_on_boundary_of_last_node(void) ...@@ -304,7 +306,9 @@ test_split_on_boundary_of_last_node(void)
} }
toku_free(sn.bp); toku_free(sn.bp);
toku_free(sn.childkeys); toku_free(sn.childkeys);
toku_free(big_val); if (big_val) {
toku_free(big_val);
}
} }
static void static void
......
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