From 9a4b58d4d700fdea99801992835f66808d026973 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Fri, 2 Oct 2020 11:20:21 +0200 Subject: [PATCH] Fix error checking on one getaddrinfo call --- pdns/notify.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/notify.cc b/pdns/notify.cc index 597b833492..69fb936813 100644 --- a/pdns/notify.cc +++ b/pdns/notify.cc @@ -97,7 +97,7 @@ try parts.push_back("domain"); else if (parts.size() != 2) throw runtime_error("Invalid hostname:port syntax"); - if (getaddrinfo(parts[0].c_str(), parts[1].c_str(), NULL, &info) < 0) + if (getaddrinfo(parts[0].c_str(), parts[1].c_str(), NULL, &info) != 0) throw runtime_error("Cannot resolve '" + string(argv[1]) +"'"); for(auto ptr = info; ptr != NULL; ptr = ptr->ai_next) addrs.emplace(ComboAddress{ptr->ai_addr, ptr->ai_addrlen}); -- 2.47.2