From: Otto Moerbeek Date: Mon, 13 Jan 2025 14:45:00 +0000 (+0100) Subject: Don't forget to delete the pointer itself X-Git-Tag: dnsdist-2.0.0-alpha1~174^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15033%2Fhead;p=thirdparty%2Fpdns.git Don't forget to delete the pointer itself --- diff --git a/pdns/recursordist/rpzloader.cc b/pdns/recursordist/rpzloader.cc index 297fe490e5..720340e103 100644 --- a/pdns/recursordist/rpzloader.cc +++ b/pdns/recursordist/rpzloader.cc @@ -383,8 +383,11 @@ struct FilenameDeleter { void operator()(const string* name) const noexcept { - if (!name->empty()) { - unlink(name->c_str()); + if (name != nullptr) { + if (!name->empty()) { + unlink(name->c_str()); + } + delete name; // NOLINT(cppcoreguidelines-owning-memory) } } };