[monitoring-plugins] Fix check_ntp_time without a socket (#2196)

GitHub git at monitoring-plugins.org
Thu Dec 4 13:30:11 CET 2025


    Module: monitoring-plugins
    Branch: master
    Commit: 3ae751ed67bb59c5073e0a160f4125ba2a5ff1e4
    Author: Lorenz Kästle <12514511+RincewindsHat at users.noreply.github.com>
 Committer: GitHub <noreply at github.com>
      Date: Thu Dec  4 13:24:14 2025 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=3ae751ed

Fix check_ntp_time without a socket (#2196)

In the previous commit I unintentionally introduced an error
through symbol shadowing.
This should fix check_ntp_time when the target address
is a network address.

---

 plugins/check_ntp_time.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
index 1300faea..9e0beb9c 100644
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
@@ -348,7 +348,6 @@ static offset_request_wrapper offset_request(const char *host, const char *port,
 		is_socket = false;
 
 		/* fill in ai with the list of hosts resolved by the host name */
-		struct addrinfo *addresses = NULL;
 		int ga_result = getaddrinfo(host, port, &hints, &addresses);
 		if (ga_result != 0) {
 			die(STATE_UNKNOWN, "error getting address for %s: %s\n", host, gai_strerror(ga_result));



More information about the Commits mailing list