ntp: close socket when duplicating fails
This commit is contained in:
parent
3d57b7a44d
commit
b7766478a6
1 changed files with 1 additions and 0 deletions
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);
|
||||||
|
|
Loading…
Reference in a new issue