Commit db6f126b authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2494], fix some leaks in the test

git-svn-id: file:///svn/toku/tokudb@19088 c7de825b-a66e-492c-adef-691d508d4ae1
parent a87006b1
......@@ -41,17 +41,31 @@ int test_main (int argc, char * const argv[]) {
r = db->put(db, txn_put, dbt_init(&key, "x", 4), dbt_init(&val, "x", 4), 0); CKERR(r);
dbt_init_malloc(&val);
r = db->get(db, txn_put, dbt_init(&key, "x", 4), &val, 0); CKERR(r);
toku_free(val.data);
dbt_init_malloc(&val);
r = db->get(db, txn_committed, dbt_init(&key, "x", 4), &val, 0); CKERR2(r, DB_NOTFOUND);
toku_free(val.data);
dbt_init_malloc(&val);
r = db->get(db, txn_uncommitted, dbt_init(&key, "x", 4), &val, 0); CKERR(r);
toku_free(val.data);
r = db->del(db, txn_put, dbt_init(&key, "a", 4), 0); CKERR(r);
dbt_init_malloc(&val);
r = db->get(db, txn_put, dbt_init(&key, "a", 4), &val, 0); CKERR2(r, DB_NOTFOUND);
toku_free(val.data);
dbt_init_malloc(&val);
r = db->get(db, txn_committed, dbt_init(&key, "a", 4), &val, 0); CKERR(r);
toku_free(val.data);
dbt_init_malloc(&val);
r = db->get(db, txn_uncommitted, dbt_init(&key, "a", 4), &val, 0); CKERR2(r, DB_NOTFOUND);
val.data = NULL;
toku_free(val.data);
val.data = NULL;
}
......@@ -73,7 +87,7 @@ int test_main (int argc, char * const argv[]) {
DBC* cursor_uncommitted = NULL;
memset(&curr_key, 0, sizeof(curr_key));
memset(&curr_val, 0, sizeof(curr_val));
r = db->cursor(db, txn_committed, &cursor_committed, 0); assert(r == 0);
r = db->cursor(db, txn_uncommitted, &cursor_uncommitted, 0); assert(r == 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