1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

wrap cli_tdis() in check to make sure we have a valid cnum

This commit is contained in:
Gerald Carter 0001-01-01 00:00:00 +00:00
parent d940a2f773
commit e54342b062

View File

@ -367,15 +367,16 @@ void cli_nt_netlogon_netsec_session_close(struct cli_state *cli)
void cli_close_connection(struct cli_state *cli)
{
/*
* tell our peer to free his resources. Wihtout this, when an
* application attempts to do a graceful shutdown and calls
* smbc_free_context() to clean up all connections, some connections
* can remain active on the peer end, until some (long) timeout period
* later. This tree disconnect forces the peer to clean up, since the
* connection will be going away.
*/
cli_tdis(cli);
/*
* tell our peer to free his resources. Wihtout this, when an
* application attempts to do a graceful shutdown and calls
* smbc_free_context() to clean up all connections, some connections
* can remain active on the peer end, until some (long) timeout period
* later. This tree disconnect forces the peer to clean up, since the
* connection will be going away.
*/
if ( cli->cnum != -1 )
cli_tdis(cli);
cli_nt_session_close(cli);
cli_nt_netlogon_netsec_session_close(cli);