]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/acl/StringData.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / acl / StringData.cc
index 778f951aadc919f2832bf2e2354b13fe277f02d2..8b48e119b5bce4cbb2fdfba5b501e26c663e095b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -31,8 +31,10 @@ xRefFree(T &thing)
 
 ACLStringData::~ACLStringData()
 {
-    if (values)
+    if (values) {
         values->destroy(xRefFree);
+        delete values;
+    }
 }
 
 static int
@@ -81,8 +83,10 @@ ACLStringData::dump() const
 void
 ACLStringData::parse()
 {
-    char *t;
+    if (!values)
+        values = new Splay<char *>();
 
+    char *t;
     while ((t = strtokFile()))
         values->insert(xstrdup(t), splaystrcmp);
 }