Commit 4f57debb authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Test 944 has some memory leaks, even when things are working. Addresses #944.

git-svn-id: file:///svn/tokudb@5197 c7de825b-a66e-492c-adef-691d508d4ae1
parent 45414a60
......@@ -53,8 +53,8 @@ void run (int choice) {
DBC *c;
r=db->cursor(db, txn, &c, 0); CKERR(r);
DBT kdbt,vdbt;
dbt_init_malloc(&kdbt);
dbt_init_malloc(&vdbt);
dbt_init(&kdbt, 0, 0);
dbt_init(&vdbt, 0, 0);
i=0;
while (0==(r=c->c_get(c, &kdbt, &vdbt, DB_NEXT))) {
//printf("Got %d %d\n", *(unsigned char*)kdbt.data, *(unsigned char*)vdbt.data);
......@@ -91,11 +91,11 @@ void run (int choice) {
DBC *c;
r=db->cursor(db, txn, &c, 0); CKERR(r);
DBT k,v;
r=c->c_get(c, dbt_init_malloc(&k), dbt_init_malloc(&v), DB_FIRST); CKERR(r);
r=c->c_get(c, dbt_init(&k, 0, 0), dbt_init(&v, 0, 0), DB_FIRST); CKERR(r);
assert(*(char*)k.data==v1); assert(*(char*)v.data==v101);
r=c->c_get(c, dbt_init_malloc(&k), dbt_init_malloc(&v), DB_NEXT); CKERR(r);
r=c->c_get(c, dbt_init(&k, 0, 0), dbt_init(&v, 0, 0), DB_NEXT); CKERR(r);
assert(*(char*)k.data==v2); assert(*(char*)v.data==v102);
r=c->c_get(c, dbt_init_malloc(&k), dbt_init_malloc(&v), DB_NEXT); assert(r!=0);
r=c->c_get(c, dbt_init(&k, 0, 0), dbt_init(&v, 0, 0), DB_NEXT); assert(r!=0);
r=c->c_close(c); CKERR(r);
r=txn->commit(txn, 0); CKERR(r);
}
......
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