From 9817dc5c7b570ee6d81e2e5cf6855b1a96a8efb3 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 13 Jan 2025 15:45:00 +0100 Subject: [PATCH] Don't forget to delete the pointer itself --- pdns/recursordist/rpzloader.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) } } }; -- 2.47.2