git://git.exim.org
/
users
/
heiko
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
62a4137
)
Avoid needless socket close
author
Jeremy Harris
<jgh146exb@wizmail.org>
Fri, 1 Jan 2021 12:09:37 +0000
(12:09 +0000)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Fri, 1 Jan 2021 12:09:37 +0000
(12:09 +0000)
src/src/ip.c
patch
|
blob
|
history
diff --git
a/src/src/ip.c
b/src/src/ip.c
index c09962a38933667e6ff10e04131a1e799f53dd20..96a6c29f20e5082d32833664fd6559b4e27eace0 100644
(file)
--- a/
src/src/ip.c
+++ b/
src/src/ip.c
@@
-463,8
+463,8
@@
for (host_item * h = &shost; h; h = h->next)
for (int port = portlo; port <= porthi; port++)
if (ip_connect(fd, af, h->address, port, timeout, fastopen_blob) == 0)
{
- if (fd != fd6) close(fd6);
- if (fd != fd4) close(fd4);
+ if (fd
6 >= 0 && fd
!= fd6) close(fd6);
+ if (fd
4 >= 0 && fd
!= fd4) close(fd4);
if (connhost)
{
h->port = port;