From 3700e0dda8bfa3f715186028087fa63aa143ec7f Mon Sep 17 00:00:00 2001 From: Axel Viala Date: Sun, 11 Dec 2022 12:41:28 +0100 Subject: [PATCH] clang-tidy: nullptr where possible. - ldapbackend.cc - recursor_cache.cc - recusor_cache.hh - zoneparser-tng.cc --- modules/ldapbackend/ldapbackend.cc | 6 +++--- pdns/zoneparser-tng.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ldapbackend/ldapbackend.cc b/modules/ldapbackend/ldapbackend.cc index 35e5e6f2fa..f400559e70 100644 --- a/modules/ldapbackend/ldapbackend.cc +++ b/modules/ldapbackend/ldapbackend.cc @@ -38,8 +38,8 @@ LdapBackend::LdapBackend(const string& suffix) try { d_qname.clear(); - d_pldap = NULL; - d_authenticator = NULL; + d_pldap = nullptr; + d_authenticator = nullptr; d_qlog = arg().mustDo("query-logging"); d_default_ttl = arg().asNum("default-ttl"); d_myname = "[LdapBackend]"; @@ -97,7 +97,7 @@ LdapBackend::LdapBackend(const string& suffix) g_log << Logger::Error << d_myname << " Caught STL exception: " << e.what() << endl; } - if (d_pldap != NULL) { + if (d_pldap != nullptr) { delete (d_pldap); } throw PDNSException("Unable to connect to ldap server"); diff --git a/pdns/zoneparser-tng.cc b/pdns/zoneparser-tng.cc index 12951790a1..c8754f366a 100644 --- a/pdns/zoneparser-tng.cc +++ b/pdns/zoneparser-tng.cc @@ -80,7 +80,7 @@ void ZoneParserTNG::stackFile(const std::string& fname) throw std::system_error(ec, "File '" + fname + "': not a regular file"); } FILE *fp = fdopen(fd, "r"); - if (!fp) { + if (fp == nullptr) { int err = errno; close(fd); std::error_code ec (err, std::generic_category()); -- 2.47.2