mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +03:00
channels: replaced bugged lists with ssh_list
cherry-picked from 0aef5f Conflicts: src/session.c
This commit is contained in:
@@ -157,6 +157,7 @@ err:
|
||||
*/
|
||||
void ssh_free(ssh_session session) {
|
||||
int i;
|
||||
struct ssh_iterator *it;
|
||||
|
||||
if (session == NULL) {
|
||||
return;
|
||||
@@ -187,9 +188,12 @@ void ssh_free(ssh_session session) {
|
||||
ssh_poll_ctx_free(session->default_poll_ctx);
|
||||
}
|
||||
/* delete all channels */
|
||||
while (session->channels) {
|
||||
ssh_channel_free(session->channels);
|
||||
while ((it=ssh_list_get_iterator(session->channels)) != NULL) {
|
||||
ssh_channel_free(ssh_iterator_value(ssh_channel,it));
|
||||
ssh_list_remove(session->channels, it);
|
||||
}
|
||||
ssh_list_free(session->channels);
|
||||
session->channels=NULL;
|
||||
#ifndef _WIN32
|
||||
agent_free(session->agent);
|
||||
#endif /* _WIN32 */
|
||||
|
||||
Reference in New Issue
Block a user