dbwrap: Simplify dbwrap_trans_store
authorVolker Lendecke <vl@samba.org>
Wed, 26 Jul 2017 13:10:55 +0000 (15:10 +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 c7971a95b855e0f782d033278c95977c0304214f..acd3c1837bc1280d54b2786f77f3286c5e520555 100644 (file)
@@ -344,24 +344,17 @@ struct dbwrap_store_context {
 
 static NTSTATUS dbwrap_store_action(struct db_context *db, void *private_data)
 {
-       struct db_record *rec = NULL;
        NTSTATUS status;
        struct dbwrap_store_context *store_ctx;
 
        store_ctx = (struct dbwrap_store_context *)private_data;
 
-       rec = dbwrap_fetch_locked(db, talloc_tos(), *(store_ctx->key));
-       if (rec == NULL) {
-               DEBUG(5, ("fetch_locked failed\n"));
-               return NT_STATUS_NO_MEMORY;
-       }
-
-       status = dbwrap_record_store(rec, *(store_ctx->dbuf), store_ctx->flag);
+       status = dbwrap_store(db, *(store_ctx->key), *(store_ctx->dbuf),
+                             store_ctx->flag);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(5, ("store returned %s\n", nt_errstr(status)));
        }
 
-       TALLOC_FREE(rec);
        return status;
 }