don't leave a dangling transaction on retry error
authorAndrew Tridgell <tridge@samba.org>
Fri, 8 Aug 2008 01:41:21 +0000 (11:41 +1000)
committerMichael Adam <obnox@samba.org>
Wed, 13 Aug 2008 09:54:10 +0000 (11:54 +0200)
(This used to be commit ddf3022595fe8ca378c5f52107f42e296f852685)

source3/lib/dbwrap_util.c

index 09e9071d8c9a69c30b78c3d8a935e506fde792c3..ddc613150bbd77ef69ec57a00faa641178faeac1 100644 (file)
@@ -210,7 +210,8 @@ NTSTATUS dbwrap_trans_store(struct db_context *db, TDB_DATA key, TDB_DATA dbuf,
        if (res != 0) {
                DEBUG(5, ("tdb_transaction_commit failed\n"));
                status = NT_STATUS_INTERNAL_DB_CORRUPTION;
-               goto cancel;
+               TALLOC_FREE(rec);
+               return status;
        }
 
        return NT_STATUS_OK;
@@ -255,7 +256,8 @@ NTSTATUS dbwrap_trans_delete(struct db_context *db, TDB_DATA key)
        if (res != 0) {
                DEBUG(5, ("tdb_transaction_commit failed\n"));
                status = NT_STATUS_INTERNAL_DB_CORRUPTION;
-               goto cancel;
+               TALLOC_FREE(rec);
+               return status;          
        }
 
        return NT_STATUS_OK;