From: Stefan Metzmacher Date: Sun, 30 Mar 2008 11:11:22 +0000 (+0200) Subject: dbwrap: fix a confusing "tdb_chainunlock failed" message X-Git-Tag: samba-3.3.0pre1~2956 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d70a8e9c413a7d3993e0d11db5ae9cbc7fdb12c7;p=thirdparty%2Fsamba.git dbwrap: fix a confusing "tdb_chainunlock failed" message Unlock before we cancel the transaction... metze --- diff --git a/source/lib/dbwrap_util.c b/source/lib/dbwrap_util.c index 1105b083e03..eea7ca79d77 100644 --- a/source/lib/dbwrap_util.c +++ b/source/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"); }