summaryrefslogtreecommitdiffstats
path: root/src/client.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-09-02 13:46:10 +0300
committerAndreas Schneider <asn@cryptomilk.org>2011-09-02 22:59:44 +0200
commit64b125700eb472787eea6dba9d2ca29d8bc360d7 (patch)
tree38bda65935a1e126b3d48b7b37e08c07d540aa9a /src/client.c
parent6f650a61ca67c8f799a3c3d2f0c17bdd42136e5f (diff)
downloadlibssh-64b125700eb472787eea6dba9d2ca29d8bc360d7.tar.gz
libssh-64b125700eb472787eea6dba9d2ca29d8bc360d7.tar.xz
libssh-64b125700eb472787eea6dba9d2ca29d8bc360d7.zip
channels: replaced bugged lists with ssh_list
(cherry picked from commit 6d8bb956c5caa48c2aba6713f067224650c3c1e1) Conflicts: src/channels.c src/session.c
Diffstat (limited to 'src/client.c')
-rw-r--r--src/client.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client.c b/src/client.c
index df8f08e4..060f20aa 100644
--- a/src/client.c
+++ b/src/client.c
@@ -755,6 +755,7 @@ int ssh_get_openssh_version(ssh_session session) {
*/
void ssh_disconnect(ssh_session session) {
ssh_string str = NULL;
+ struct ssh_iterator *it;
int i;
if (session == NULL) {
@@ -793,8 +794,10 @@ error:
}
session->fd = SSH_INVALID_SOCKET;
session->session_state=SSH_SESSION_STATE_DISCONNECTED;
- 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);
}
if(session->current_crypto){
crypto_free(session->current_crypto);