dbwrap: Simplify dbwrap_trans_delete
authorVolker Lendecke <vl@samba.org>
Wed, 26 Jul 2017 13:12:21 +0000 (15:12 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 15 Aug 2017 22:27:10 +0000 (00:27 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/dbwrap/dbwrap_util.c

index acd3c1837bc1280d54b2786f77f3286c5e520555..cb98d742186c6504576e52b8cdff7853c38414b2 100644 (file)
@@ -376,22 +376,13 @@ NTSTATUS dbwrap_trans_store(struct db_context *db, TDB_DATA key, TDB_DATA dbuf,
 static NTSTATUS dbwrap_delete_action(struct db_context * db, void *private_data)
 {
        NTSTATUS status;
-       struct db_record *rec;
        TDB_DATA *key = (TDB_DATA *)private_data;
 
-       rec = dbwrap_fetch_locked(db, talloc_tos(), *key);
-       if (rec == NULL) {
-               DEBUG(5, ("fetch_locked failed\n"));
-               return NT_STATUS_NO_MEMORY;
-       }
-
-       status = dbwrap_record_delete(rec);
+       status = dbwrap_delete(db, *key);
        if (!NT_STATUS_IS_OK(status)) {
                DBG_INFO("dbwrap_record_delete returned %s\n",
                         nt_errstr(status));
        }
-
-       talloc_free(rec);
        return  status;
 }