mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
client: use ssh_channel_do_free in ssh_disconnect
Ensure to use 'ssh_channel_do_free' in 'ssh_disconnect', when removing and free'ing up a session's channels. This matches the behavior in 'ssh_free', and is necessary to fully free any channel which may not have been closed completely (see usage of flags SSH_CHANNEL_FLAG_CLOSED_REMOTE, SSH_CHANNEL_FLAG_FREED_LOCAL). Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
4f4e917187
commit
0557f57c63
@@ -652,7 +652,7 @@ error:
|
|||||||
session->session_state=SSH_SESSION_STATE_DISCONNECTED;
|
session->session_state=SSH_SESSION_STATE_DISCONNECTED;
|
||||||
|
|
||||||
while ((it=ssh_list_get_iterator(session->channels)) != NULL) {
|
while ((it=ssh_list_get_iterator(session->channels)) != NULL) {
|
||||||
ssh_channel_free(ssh_iterator_value(ssh_channel,it));
|
ssh_channel_do_free(ssh_iterator_value(ssh_channel,it));
|
||||||
ssh_list_remove(session->channels, it);
|
ssh_list_remove(session->channels, it);
|
||||||
}
|
}
|
||||||
if(session->current_crypto){
|
if(session->current_crypto){
|
||||||
|
|||||||
Reference in New Issue
Block a user