summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-09-09 19:02:53 +0000
committerJeremy Allison <jra@samba.org>2002-09-09 19:02:53 +0000
commit48c91e8b2a01628d03f1d2bdc49c32966d41c96c (patch)
tree9f24b97a7c3d3c9565825d34162c44a3373b6c13
parent2517c20b9efc66b4e6fa81b4d4ea086341c58dfe (diff)
downloadsamba-48c91e8b2a01628d03f1d2bdc49c32966d41c96c.tar.gz
samba-48c91e8b2a01628d03f1d2bdc49c32966d41c96c.tar.bz2
samba-48c91e8b2a01628d03f1d2bdc49c32966d41c96c.zip
Merged Volkers (correct) fix from 2.2 for crash on unable to connect.
Jeremy. (This used to be commit 05e2aba52f9b027bbab7c65cc02fd5c83d3c61aa)
-rw-r--r--source3/libsmb/clientgen.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index facf361a6b..6b6a2acd3b 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -212,9 +212,8 @@ struct cli_state *cli_initialise(struct cli_state *cli)
alloced_cli = True;
}
- if (cli->initialised) {
- cli_shutdown(cli);
- }
+ if (cli->initialised)
+ cli_close_connection(cli);
ZERO_STRUCTP(cli);
@@ -286,11 +285,14 @@ void cli_close_connection(struct cli_state *cli)
data_blob_free(&cli->secblob);
- if (cli->mem_ctx)
+ if (cli->mem_ctx) {
talloc_destroy(cli->mem_ctx);
+ cli->mem_ctx = NULL;
+ }
if (cli->fd != -1)
close(cli->fd);
+ cli->fd = -1;
}
/****************************************************************************