mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 09:12:24 +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:
parent
8329d192be
commit
0212b9e5e5
@ -1015,6 +1015,8 @@ static void sk_net_close(Socket *sock)
|
|||||||
if (s->child)
|
if (s->child)
|
||||||
sk_net_close(&s->child->sock);
|
sk_net_close(&s->child->sock);
|
||||||
|
|
||||||
|
bufchain_clear(&s->output_data);
|
||||||
|
|
||||||
del234(sktree, s);
|
del234(sktree, s);
|
||||||
if (s->s >= 0) {
|
if (s->s >= 0) {
|
||||||
uxsel_del(s->s);
|
uxsel_del(s->s);
|
||||||
|
@ -1337,6 +1337,8 @@ static void sk_net_close(Socket *sock)
|
|||||||
if (s->child)
|
if (s->child)
|
||||||
sk_net_close(&s->child->sock);
|
sk_net_close(&s->child->sock);
|
||||||
|
|
||||||
|
bufchain_clear(&s->output_data);
|
||||||
|
|
||||||
del234(sktree, s);
|
del234(sktree, s);
|
||||||
do_select(s->s, false);
|
do_select(s->s, false);
|
||||||
p_closesocket(s->s);
|
p_closesocket(s->s);
|
||||||
|
Loading…
Reference in New Issue
Block a user