]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Fix warnings from cppcheck 12542/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 13 Feb 2023 12:53:43 +0000 (13:53 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 14 Feb 2023 11:42:32 +0000 (12:42 +0100)
commit26512612c834aa3e61d5ce384c999c9371d03698
tree35285ecf78ef86f69725f61651fa71a5d577513d
parentba2cd6c9ec0996bb3634fce2be5fc25847960494
dnsdist: Fix warnings from cppcheck

Most of these are 'performance' warnings in parts of code where performance
does not really matter, but there is no harm in being more consistent.
It also makes it easier to spot more meaningful warnings in the future.
The remaining changes are false-positives where cppcheck does not detect
that null-pointer dereferences cannot actually happen, so I edited
the code to make it clearer (removing redundant checks in some cases,
actually adding some in other cases).
14 files changed:
pdns/dnsdist-cache.cc
pdns/dnsdist-dynblocks.hh
pdns/dnsdist-lua-actions.cc
pdns/dnsdist-lua-bindings-dnsquestion.cc
pdns/dnsdist-lua-bindings.cc
pdns/dnsdist-lua-rules.cc
pdns/dnsdist-lua.cc
pdns/dnsdist-lua.hh
pdns/dnsdist.cc
pdns/dnsdistdist/dnsdist-async.cc
pdns/dnsdistdist/dnsdist-backend.cc
pdns/dnsdistdist/dnsdist-lua-bindings-dnscrypt.cc
pdns/dnsdistdist/dnsdist-rules.hh
pdns/dnswriter.cc