if (txn->opened) {
if (txn->cursor != NULL) {
mdb_cursor_close(txn->cursor);
- txn->cursor = false;
+ txn->cursor = NULL;
}
mdb_txn_abort(txn->txn);
txn->opened = false;
}
if (txn->cursor != NULL) {
mdb_cursor_close(txn->cursor);
- txn->cursor = false;
+ txn->cursor = NULL;
}
txn->ret = mdb_txn_commit(txn->txn);
err_to_knot(&txn->ret);
- if (txn->ret == KNOT_EOK) {
- txn->opened = false;
- } else {
- knot_lmdb_abort(txn);
- }
+ txn->opened = false;
}
// save the programmer's frequent checking for ENOMEM when creating search keys