From e73e8297f5484b6c7f525917679414c09a145cf0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Apr 2008 13:51:46 +0200 Subject: Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct (This used to be commit 99fc3283c4ecc791f5a242bd1983b4352ce3e6cf) --- source3/libsmb/clientgen.c | 48 +++++----------------------------------------- 1 file changed, 5 insertions(+), 43 deletions(-) (limited to 'source3/libsmb/clientgen.c') diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index ef2c2639cd..e64b6fa278 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -616,55 +616,17 @@ struct cli_state *cli_initialise(void) return NULL; } -/**************************************************************************** - External interface. - Close an open named pipe over SMB. Free any authentication data. - Returns false if the cli_close call failed. - ****************************************************************************/ - -bool cli_rpc_pipe_close(struct rpc_pipe_client *cli) -{ - bool ret; - - if (!cli) { - return false; - } - - ret = cli_close(cli->cli, cli->fnum); - - if (!ret) { - DEBUG(1,("cli_rpc_pipe_close: cli_close failed on pipe %s, " - "fnum 0x%x " - "to machine %s. Error was %s\n", - cli->pipe_name, - (int) cli->fnum, - cli->desthost, - cli_errstr(cli->cli))); - } - - if (cli->auth.cli_auth_data_free_func) { - (*cli->auth.cli_auth_data_free_func)(&cli->auth); - } - - DEBUG(10,("cli_rpc_pipe_close: closed pipe %s to machine %s\n", - cli->pipe_name, cli->desthost )); - - DLIST_REMOVE(cli->cli->pipe_list, cli); - talloc_destroy(cli); - return ret; -} - /**************************************************************************** Close all pipes open on this session. ****************************************************************************/ void cli_nt_pipes_close(struct cli_state *cli) { - struct rpc_pipe_client *cp, *next; - - for (cp = cli->pipe_list; cp; cp = next) { - next = cp->next; - cli_rpc_pipe_close(cp); + while (cli->pipe_list != NULL) { + /* + * No TALLOC_FREE here! + */ + talloc_free(cli->pipe_list); } } -- cgit