mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-06 13:05:06 -05:00
ntp: close socket when duplicating fails
This commit is contained in:
1
ntp_io.c
1
ntp_io.c
@@ -338,6 +338,7 @@ reconnect_socket(int sock_fd, NTP_Remote_Address *remote_addr)
|
|||||||
/* Replace the original socket */
|
/* Replace the original socket */
|
||||||
if (dup2(fd, sock_fd) != sock_fd) {
|
if (dup2(fd, sock_fd) != sock_fd) {
|
||||||
DEBUG_LOG(LOGF_NtpIO, "Could not duplicate socket : %s", strerror(errno));
|
DEBUG_LOG(LOGF_NtpIO, "Could not duplicate socket : %s", strerror(errno));
|
||||||
|
close_socket(fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
close_socket(fd);
|
close_socket(fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user