diff options
author | Jeremy Allison <jra@samba.org> | 2002-09-03 19:19:20 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-09-03 19:19:20 +0000 |
commit | e33e9defa657aa54594bb0c27f9be2f7b12aab1b (patch) | |
tree | 602540cd14e419055f78ff3f5e15bac1e5b6fd28 /source/libsmb/cliconnect.c | |
parent | 3b71529c694b5b1093d99b7ef80835e72b1f8436 (diff) | |
download | samba-e33e9defa657aa54594bb0c27f9be2f7b12aab1b.tar.gz |
Fix crashbug discovered by "Kim R. Pedersen" <krp@filanet.dk> where
cli struct was being deallocated in a called function.
Jeremy.
Diffstat (limited to 'source/libsmb/cliconnect.c')
-rw-r--r-- | source/libsmb/cliconnect.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c index 9ff48549980..885463bd345 100644 --- a/source/libsmb/cliconnect.c +++ b/source/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" <krp@filanet.dk>. + */ + + cli_close_connection(cli); if (!cli_initialise(cli) || !cli_connect(cli, desthost, pdest_ip) || |