From: Emeric Brun Date: Mon, 15 Feb 2021 14:20:19 +0000 (+0100) Subject: BUG/MEDIUM: dns: fix multiple double close on fd in dns.c X-Git-Tag: v2.4-dev9~44 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=267221557fe2a0641f3ab93d546a7580852d5809;p=haproxy-2.5.git BUG/MEDIUM: dns: fix multiple double close on fd in dns.c It seems that fd_delete perform the close of the file descriptor Se we must not close the fd once again after that. This should fix issues #1128, #1130 and #1131 --- diff --git a/src/dns.c b/src/dns.c index 58c68d7..cb30bff 100644 --- a/src/dns.c +++ b/src/dns.c @@ -117,7 +117,6 @@ int dns_send_nameserver(struct dns_nameserver *ns, void *buf, size_t len) } ns->counters->snd_error++; fd_delete(fd); - close(fd); dgram->t.sock.fd = -1; return -1; } @@ -164,7 +163,6 @@ ssize_t dns_recv_nameserver(struct dns_nameserver *ns, void *data, size_t size) return 0; } fd_delete(fd); - close(fd); dgram->t.sock.fd = -1; return -1; } @@ -342,7 +340,6 @@ static void dns_resolve_send(struct dgram_conn *dgram) } ns->counters->snd_error++; fd_delete(fd); - close(fd); fd = dgram->t.sock.fd = -1; goto out; }