1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

ssh2connection: clean up callbacks on exit.

We use a toplevel callback in the SSH-2 connection layer for checking
whether it's time to close the whole SSH session after a channel
closes. If the channel close itself, or something close enough to it,
involves a protocol error severe enough to abort the session and free
the connection layer, then that callback can fire anyway on stale
data.

The fix is the same as it always is in these situations: any object
which is ever used as the context parameter to queue_toplevel_callback
should also be passed to delete_callbacks_for_context before freeing it.
This commit is contained in:
Simon Tatham 2019-04-20 07:57:08 +01:00
parent af01a6f07c
commit 4dcc0fddf7

View File

@ -310,6 +310,8 @@ static void ssh2_connection_free(PacketProtocolLayer *ppl)
}
portfwdmgr_free(s->portfwdmgr);
delete_callbacks_for_context(s);
sfree(s);
}