From ff0eed62d3334cd720122d97e38df9cf8651acc7 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 26 Jul 2017 15:14:51 +0200 Subject: dbwrap: Simplify dbwrap_unmarshall_fn Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/dbwrap/dbwrap_util.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'lib/dbwrap') diff --git a/lib/dbwrap/dbwrap_util.c b/lib/dbwrap/dbwrap_util.c index cb98d742186..df6dea40097 100644 --- a/lib/dbwrap/dbwrap_util.c +++ b/lib/dbwrap/dbwrap_util.c @@ -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; } -- cgit v1.2.1