]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Don't forget to delete the pointer itself 15033/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 13 Jan 2025 14:45:00 +0000 (15:45 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 13 Jan 2025 15:35:58 +0000 (16:35 +0100)
pdns/recursordist/rpzloader.cc

index 297fe490e5c8dcdc451dcc326dfd7f2a9017f727..720340e103d5d558d4af8b08dc8edc59dd938040 100644 (file)
@@ -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)
     }
   }
 };