summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cabrero <scabrero@samba.org>2022-04-13 11:15:35 +0200
committerJule Anger <janger@samba.org>2022-04-15 13:46:10 +0000
commitbe6712bd6151548168bd77a670c7576383c3c7f6 (patch)
tree48e2728555d7002573608decf86d95835fce6806
parent621b80645a47dc41b53217785b835706a1677468 (diff)
downloadsamba-be6712bd6151548168bd77a670c7576383c3c7f6.tar.gz
s3:winbind: Simplify open_cached_internal_pipe_conn()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15046 Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 91395e660a2b1b69bf74ca0b77aee416e2ac1db3)
-rw-r--r--source3/winbindd/winbindd_samr.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source3/winbindd/winbindd_samr.c b/source3/winbindd/winbindd_samr.c
index d5c4e8e1f4f..ebf9c24b9e4 100644
--- a/source3/winbindd/winbindd_samr.c
+++ b/source3/winbindd/winbindd_samr.c
@@ -150,9 +150,10 @@ static NTSTATUS open_cached_internal_pipe_conn(
struct rpc_pipe_client **lsa_pipe,
struct policy_handle *lsa_hnd)
{
- struct winbind_internal_pipes *internal_pipes = NULL;
+ struct winbind_internal_pipes *internal_pipes =
+ domain->backend_data.samr_pipes;
- if (domain->backend_data.samr_pipes == NULL) {
+ if (internal_pipes == NULL) {
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -190,14 +191,11 @@ static NTSTATUS open_cached_internal_pipe_conn(
}
domain->backend_data.samr_pipes =
- talloc_move(domain, &internal_pipes);
+ talloc_steal(domain, internal_pipes);
TALLOC_FREE(frame);
-
}
- internal_pipes = domain->backend_data.samr_pipes;
-
if (samr_domain_hnd) {
*samr_domain_hnd = internal_pipes->samr_domain_hnd;
}