From 29ec750566d2e7208afff6a97f319553c6431efd Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Wed, 13 Apr 2022 11:15:35 +0200 Subject: s3:winbind: Simplify open_cached_internal_pipe_conn() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15046 Signed-off-by: Samuel Cabrero Reviewed-by: Stefan Metzmacher Reviewed-by: Andreas Schneider (cherry picked from commit 91395e660a2b1b69bf74ca0b77aee416e2ac1db3) --- source3/winbindd/winbindd_samr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source3/winbindd/winbindd_samr.c b/source3/winbindd/winbindd_samr.c index ce66adcc0c7..20b5d758d1a 100644 --- a/source3/winbindd/winbindd_samr.c +++ b/source3/winbindd/winbindd_samr.c @@ -128,9 +128,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; @@ -157,14 +158,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; } -- cgit v1.2.1