summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2022-06-24 11:59:21 +0000
committerRalph Boehme <slow@samba.org>2022-07-26 13:40:34 +0000
commit6702b3b0da729b824455a5efc7b50ebc03f835e8 (patch)
tree360022a9dbe6788dcdbbfa5f8e0a6a3579ab4776 /source3/lib
parent7226d0b365625ab0e5ff0ffe8b8fe3924ae1a569 (diff)
downloadsamba-6702b3b0da729b824455a5efc7b50ebc03f835e8.tar.gz
s3:dbwrap_watch: use dbwrap_record_get_key() to access the key
We should avoid doing shortcuts if not needed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap/dbwrap_watch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/dbwrap/dbwrap_watch.c b/source3/lib/dbwrap/dbwrap_watch.c
index b531c3b6fc6..d57a70ba07f 100644
--- a/source3/lib/dbwrap/dbwrap_watch.c
+++ b/source3/lib/dbwrap/dbwrap_watch.c
@@ -280,6 +280,7 @@ static int db_watched_record_destructor(struct db_watched_record *wrec)
{
struct dbwrap_watched_add_watcher_state state = { .w = wrec->added };
struct db_context *backend = dbwrap_record_get_db(wrec->subrec);
+ TDB_DATA key = dbwrap_record_get_key(wrec->subrec);
NTSTATUS status;
if (wrec->added.pid.pid == 0) {
@@ -287,7 +288,7 @@ static int db_watched_record_destructor(struct db_watched_record *wrec)
}
status = dbwrap_do_locked(
- backend, wrec->subrec->key, dbwrap_watched_add_watcher, &state);
+ backend, key, dbwrap_watched_add_watcher, &state);
if (!NT_STATUS_IS_OK(status)) {
DBG_WARNING("dbwrap_do_locked failed: %s\n",
nt_errstr(status));
@@ -489,6 +490,7 @@ static void dbwrap_watched_record_wakeup(
struct db_record *rec, struct db_watched_record *wrec)
{
struct db_context *backend = dbwrap_record_get_db(wrec->subrec);
+ TDB_DATA key = dbwrap_record_get_key(wrec->subrec);
struct db_context *db = dbwrap_record_get_db(rec);
struct db_watched_ctx *ctx = talloc_get_type_abort(
db->private_data, struct db_watched_ctx);
@@ -508,7 +510,7 @@ static void dbwrap_watched_record_wakeup(
status = dbwrap_do_locked(
backend,
- wrec->subrec->key,
+ key,
dbwrap_watched_record_wakeup_fn,
&state);
if (!NT_STATUS_IS_OK(status)) {