dbwrap: fix a confusing "tdb_chainunlock failed" message
authorStefan Metzmacher <metze@samba.org>
Sun, 30 Mar 2008 11:11:22 +0000 (13:11 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 1 Apr 2008 12:04:23 +0000 (14:04 +0200)
Unlock before we cancel the transaction...

metze
(This used to be commit d70a8e9c413a7d3993e0d11db5ae9cbc7fdb12c7)

source3/lib/dbwrap_util.c

index 1105b083e03eb8eb8e81f322bfa607dec0bb2f67..eea7ca79d7748a25dd529501fe7460d869a7243d 100644 (file)
@@ -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");
        }