From b2f1a29e4348a5bc34a87d72d526e23e421ed9d5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Sep 2004 05:44:59 +0000 Subject: r2710: continue with the new style of providing a parent context whenever possible to a structure creation routine. This makes for much easier global cleanup. (This used to be commit e14ee428ec357fab76a960387a9820a673786e27) --- source4/librpc/rpc/dcerpc_smb.c | 3 ++- source4/librpc/rpc/dcerpc_util.c | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/librpc') diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c index 893093c050..ffe7e55a85 100644 --- a/source4/librpc/rpc/dcerpc_smb.c +++ b/source4/librpc/rpc/dcerpc_smb.c @@ -334,6 +334,7 @@ static NTSTATUS smb_shutdown_pipe(struct dcerpc_pipe *p) c.close.in.fnum = smb->fnum; c.close.in.write_time = 0; smb_raw_close(smb->tree, &c); + talloc_free(smb); return NT_STATUS_OK; @@ -433,7 +434,7 @@ NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe **p, } smb->fnum = io.ntcreatex.out.fnum; - smb->tree = talloc_reference(smb, tree); + smb->tree = tree; (*p)->transport.private = smb; diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index 71fe2c63e1..bcadd52104 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -460,12 +460,12 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_np(struct dcerpc_pipe **p, } if (!username || !username[0]) { - status = smbcli_full_connection(&cli, lp_netbios_name(), + status = smbcli_full_connection(NULL, &cli, lp_netbios_name(), binding->host, NULL, "ipc$", "?????", "", "", NULL, 0, &retry); } else { - status = smbcli_full_connection(&cli, lp_netbios_name(), + status = smbcli_full_connection(NULL, &cli, lp_netbios_name(), binding->host, NULL, "ipc$", "?????", username, domain, @@ -486,7 +486,6 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_np(struct dcerpc_pipe **p, /* this ensures that the reference count is decremented so a pipe close will really close the link */ - talloc_free(cli->tree); talloc_steal(*p, cli); (*p)->flags = binding->flags; -- cgit