dbwrap: Simplify dbwrap_unmarshall_fn
authorVolker Lendecke <vl@samba.org>
Wed, 26 Jul 2017 13:14:51 +0000 (15:14 +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 cb98d742186c6504576e52b8cdff7853c38414b2..df6dea40097df145199a07c6596633bf91c95276 100644 (file)
@@ -709,22 +709,12 @@ static bool dbwrap_unmarshall_fn(TDB_DATA key, TDB_DATA value,
                                 void *private_data)
 {
        struct dbwrap_unmarshall_state *state = private_data;
-       struct db_record *rec;
        NTSTATUS status;
 
-       rec = dbwrap_fetch_locked(state->db, state->db, key);
-       if (rec == NULL) {
-               DEBUG(10, ("%s: dbwrap_fetch_locked failed\n",
-                          __func__));
-               state->ret = NT_STATUS_NO_MEMORY;
-               return false;
-       }
-
-       status = dbwrap_record_store(rec, value, 0);
-       TALLOC_FREE(rec);
+       status = dbwrap_store(state->db, key, value, 0);
        if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(10, ("%s: dbwrap_record_store failed: %s\n",
-                          __func__, nt_errstr(status)));
+               DBG_DEBUG("dbwrap_record_store failed: %s\n",
+                         nt_errstr(status));
                state->ret = status;
                return false;
        }