1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-01 05:47:28 +03:00

dbwrap_tdb: Avoid double-call to talloc_get_type_abort

We've already retrieved "ctx" in the callers of db_tdb_fetch_locked_internal().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2018-08-16 13:18:14 +02:00
parent 5e4f34e707
commit b6b7c15758

View File

@ -111,10 +111,11 @@ static int db_tdb_fetchlock_parse(TDB_DATA key, TDB_DATA data,
}
static struct db_record *db_tdb_fetch_locked_internal(
struct db_context *db, TALLOC_CTX *mem_ctx, TDB_DATA key)
struct db_context *db,
struct db_tdb_ctx *ctx,
TALLOC_CTX *mem_ctx,
TDB_DATA key)
{
struct db_tdb_ctx *ctx = talloc_get_type_abort(db->private_data,
struct db_tdb_ctx);
struct tdb_fetch_locked_state state;
int ret;
@ -162,7 +163,7 @@ static struct db_record *db_tdb_fetch_locked(
DEBUG(3, ("tdb_chainlock failed\n"));
return NULL;
}
return db_tdb_fetch_locked_internal(db, mem_ctx, key);
return db_tdb_fetch_locked_internal(db, ctx, mem_ctx, key);
}
static struct db_record *db_tdb_try_fetch_locked(
@ -176,7 +177,7 @@ static struct db_record *db_tdb_try_fetch_locked(
DEBUG(3, ("tdb_chainlock_nonblock failed\n"));
return NULL;
}
return db_tdb_fetch_locked_internal(db, mem_ctx, key);
return db_tdb_fetch_locked_internal(db, ctx, mem_ctx, key);
}
static NTSTATUS db_tdb_do_locked(struct db_context *db, TDB_DATA key,