cf-socket: if FD_CLOEXEC fails on accepted socket, cleanup

Follow-up to 9d7b532404

Pointed out by ZeroPath

Closes #19098
This commit is contained in:
Daniel Stenberg 2025-10-17 13:23:46 +02:00
parent fbff1d5b90
commit c0564ceb3a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -2138,6 +2138,7 @@ static CURLcode cf_tcp_accept_connect(struct Curl_cfilter *cf,
(curlx_nonblock(s_accepted, TRUE) < 0)) {
failf(data, "fcntl set CLOEXEC/NONBLOCK: %s",
curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
Curl_socket_close(data, cf->conn, s_accepted);
return CURLE_FTP_ACCEPT_FAILED;
}
#endif