From 20dc21f4740588eb9ff95c223cc82bea7b3aa9f7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 30 Mar 2008 13:11:22 +0200 Subject: dbwrap: fix a confusing "tdb_chainunlock failed" message Unlock before we cancel the transaction... metze (This used to be commit d70a8e9c413a7d3993e0d11db5ae9cbc7fdb12c7) --- source3/lib/dbwrap_util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/lib') diff --git a/source3/lib/dbwrap_util.c b/source3/lib/dbwrap_util.c index 1105b083e0..eea7ca79d7 100644 --- a/source3/lib/dbwrap_util.c +++ b/source3/lib/dbwrap_util.c @@ -160,7 +160,7 @@ NTSTATUS dbwrap_trans_store(struct db_context *db, TDB_DATA key, TDB_DATA dbuf, int flag) { int res; - struct db_record *rec; + struct db_record *rec = NULL; NTSTATUS status; res = db->transaction_start(db); @@ -194,6 +194,8 @@ NTSTATUS dbwrap_trans_store(struct db_context *db, TDB_DATA key, TDB_DATA dbuf, return NT_STATUS_OK; cancel: + TALLOC_FREE(rec); + if (db->transaction_cancel(db) != 0) { smb_panic("Cancelling transaction failed"); } -- cgit