mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
uxnet.c: don't close a socket's fd if it is -1.
This is harmless in principle (you just get EBADF back from close(2) and ignore it), but it leads to warnings in valgrind.
This commit is contained in:
parent
16214ea0f5
commit
f813e9f937
@ -1023,9 +1023,11 @@ static void sk_tcp_close(Socket sock)
|
|||||||
if (s->child)
|
if (s->child)
|
||||||
sk_tcp_close((Socket)s->child);
|
sk_tcp_close((Socket)s->child);
|
||||||
|
|
||||||
uxsel_del(s->s);
|
|
||||||
del234(sktree, s);
|
del234(sktree, s);
|
||||||
close(s->s);
|
if (s->s >= 0) {
|
||||||
|
uxsel_del(s->s);
|
||||||
|
close(s->s);
|
||||||
|
}
|
||||||
if (s->addr)
|
if (s->addr)
|
||||||
sk_addr_free(s->addr);
|
sk_addr_free(s->addr);
|
||||||
sfree(s);
|
sfree(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user