From 0d9cde27370e3c6cc6df28c7ee8a32aa57e3ce42 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 Sep 2002 19:19:20 +0000 Subject: Fix crashbug discovered by "Kim R. Pedersen" where cli struct was being deallocated in a called function. Jeremy. (This used to be commit e33e9defa657aa54594bb0c27f9be2f7b12aab1b) --- source3/libsmb/cliconnect.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 9ff4854998..885463bd34 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -1307,7 +1307,13 @@ with error %s.\n", desthost, cli_errstr(cli) )); return False; } - cli_shutdown(cli); + /* + * We need to close the connection here but can't call cli_shutdown as + * will free an allocated cli struct. cli_close_connection was invented + * for this purpose. JRA. Based on work by "Kim R. Pedersen" . + */ + + cli_close_connection(cli); if (!cli_initialise(cli) || !cli_connect(cli, desthost, pdest_ip) || -- cgit