mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-01 13:20:36 +00:00
Don't leak sockets when getsockname fails.
This commit is contained in:
1 parent
4dc9c657ad
commit
46b066565e
1 file changed
+7
-2
+7
-2
@@ -1345,10 +1345,15 @@ static void check_dns_listeners(fd_set *set, time_t now)
|
||||
|
||||
while ((confd = accept(listener->tcpfd, NULL, NULL)) == -1 && errno == EINTR);
|
||||
|
||||
if (confd == -1 ||
|
||||
getsockname(confd, (struct sockaddr *)&tcp_addr, &tcp_len) == -1)
|
||||
if (confd == -1)
|
||||
continue;
|
||||
|
||||
if (getsockname(confd, (struct sockaddr *)&tcp_addr, &tcp_len) == -1)
|
||||
{
|
||||
close(confd);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (option_bool(OPT_NOWILD))
|
||||
iface = listener->iface; /* May be NULL */
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user