diff --git a/unix/uxnet.c b/unix/uxnet.c index 77a381f9..0dbb0ca5 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -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); diff --git a/windows/winnet.c b/windows/winnet.c index 0d42c989..b65e8d33 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -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);