1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

sk_net_close: fix memory leak of output bufchain.

If there was still pending output data on a NetSocket's output_data
bufchain when it was closed, then we wouldn't have freed it, on either
Unix or Windows.
This commit is contained in:
Simon Tatham 2019-01-29 20:13:47 +00:00
parent 8329d192be
commit 0212b9e5e5
2 changed files with 4 additions and 0 deletions

View File

@ -1015,6 +1015,8 @@ static void sk_net_close(Socket *sock)
if (s->child)
sk_net_close(&s->child->sock);
bufchain_clear(&s->output_data);
del234(sktree, s);
if (s->s >= 0) {
uxsel_del(s->s);

View File

@ -1337,6 +1337,8 @@ static void sk_net_close(Socket *sock)
if (s->child)
sk_net_close(&s->child->sock);
bufchain_clear(&s->output_data);
del234(sktree, s);
do_select(s->s, false);
p_closesocket(s->s);