mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
The new ssh_do_close() function itself causes a segfault if the
connection goes foom before ssh->channels is set up. Oops. Fixed. [originally from svn r3141]
This commit is contained in:
parent
c1d61052ae
commit
1f9c9bb00f
26
ssh.c
26
ssh.c
@ -2051,19 +2051,21 @@ static void ssh_do_close(Ssh ssh)
|
||||
* Now we must shut down any port and X forwardings going
|
||||
* through this connection.
|
||||
*/
|
||||
for (i = 0; NULL != (c = index234(ssh->channels, i)); i++) {
|
||||
switch (c->type) {
|
||||
case CHAN_X11:
|
||||
x11_close(c->u.x11.s);
|
||||
break;
|
||||
case CHAN_SOCKDATA:
|
||||
pfd_close(c->u.pfd.s);
|
||||
break;
|
||||
if (ssh->channels) {
|
||||
for (i = 0; NULL != (c = index234(ssh->channels, i)); i++) {
|
||||
switch (c->type) {
|
||||
case CHAN_X11:
|
||||
x11_close(c->u.x11.s);
|
||||
break;
|
||||
case CHAN_SOCKDATA:
|
||||
pfd_close(c->u.pfd.s);
|
||||
break;
|
||||
}
|
||||
del234(ssh->channels, c);
|
||||
if (ssh->version == 2)
|
||||
bufchain_clear(&c->v.v2.outbuffer);
|
||||
sfree(c);
|
||||
}
|
||||
del234(ssh->channels, c);
|
||||
if (ssh->version == 2)
|
||||
bufchain_clear(&c->v.v2.outbuffer);
|
||||
sfree(c);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user