connection goes foom before ssh->channels is set up. Oops. Fixed.
git-svn-id: svn://svn.tartarus.org/sgt/putty@3141
cda61777-01e9-0310-a592-
d414129be87e
* Now we must shut down any port and X forwardings going
* through this connection.
*/
* 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);