summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/dbwrap/dbwrap_tdb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/dbwrap/dbwrap_tdb.c b/source3/lib/dbwrap/dbwrap_tdb.c
index 2041613be2..59ed7910f7 100644
--- a/source3/lib/dbwrap/dbwrap_tdb.c
+++ b/source3/lib/dbwrap/dbwrap_tdb.c
@@ -110,7 +110,12 @@ static struct db_record *db_tdb_fetch_locked_internal(
state.mem_ctx = mem_ctx;
state.result = NULL;
- tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse, &state);
+ if ((tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse,
+ &state) < 0) &&
+ (tdb_error(ctx->wtdb->tdb) != TDB_ERR_NOEXIST)) {
+ tdb_chainunlock(ctx->wtdb->tdb, key);
+ return NULL;
+ }
if (state.result == NULL) {
db_tdb_fetchlock_parse(key, tdb_null, &state);