From: Chris Hofstaedtler Date: Fri, 2 Oct 2020 09:20:21 +0000 (+0200) Subject: Fix error checking on one getaddrinfo call X-Git-Tag: auth-4.4.0-alpha2~44^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9578%2Fhead;p=thirdparty%2Fpdns.git Fix error checking on one getaddrinfo call --- 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});