]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/acl/AclNameList.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / acl / AclNameList.h
index c7dec43294bd0c1229687f09b68e6d15ef3fca62..1ef84bbc647e5fc2f834ac9cad2ac9925066db77 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
 #define SQUID_ACL_ACLNAMELIST_H_
 
 #include "acl/forward.h"
+#include "mem/forward.h"
 
-/// list of name-based ACLs. Currently a POD.
+/// list of name-based ACLs
 class AclNameList
 {
+    MEMPROXY_CLASS(AclNameList);
+
 public:
+    AclNameList(const char *t) {
+        xstrncpy(name, t, ACL_NAME_SZ-1);
+    }
+    ~AclNameList() {
+        // recursion is okay, these lists are short
+        delete next;
+    }
+
     char name[ACL_NAME_SZ];
-    AclNameList *next;
+    AclNameList *next = nullptr;
 };
 // TODO: convert to a std::list<string>