summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-11-05 06:56:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:30 -0500
commitba8b9d49cd6b72a31673a189214d979248a30a6b (patch)
tree503f981183a8369c4d610f94dd2a2adfbff584bb /source4/librpc/rpc
parentc772c754001a62cd86581cfd634b925e491f44f9 (diff)
downloadsamba-ba8b9d49cd6b72a31673a189214d979248a30a6b.tar.gz
samba-ba8b9d49cd6b72a31673a189214d979248a30a6b.tar.bz2
samba-ba8b9d49cd6b72a31673a189214d979248a30a6b.zip
r3542: Re-indent, and fix a use-after-free by doing the talloc_destroy just a
little later. Andrew Bartlett (This used to be commit b7c2a4fc34ef09b177508dcf475055523b84587c)
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc_util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 3e460af8e7..a717bdbc91 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -810,10 +810,8 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_np(struct dcerpc_pipe **p,
smbcli_tdis(cli);
smbcli_shutdown(cli);
talloc_destroy(mem_ctx);
- return status;
- }
-
- talloc_destroy(mem_ctx);
+ return status;
+ }
/* this ensures that the reference count is decremented so
a pipe close will really close the link */
@@ -824,6 +822,8 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_np(struct dcerpc_pipe **p,
/* remember the binding string for possible secondary connections */
(*p)->binding_string = dcerpc_binding_string((*p), binding);
+ talloc_destroy(mem_ctx);
+
if (username && username[0] && (binding->flags & DCERPC_SCHANNEL_ANY)) {
status = dcerpc_bind_auth_schannel(*p, pipe_uuid, pipe_version,
domain, username, password);