]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Avoid annotation leaks by properly destroying NotePairs entries.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 17 May 2013 23:05:23 +0000 (17:05 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 17 May 2013 23:05:23 +0000 (17:05 -0600)
The leak was added with the "note" directive (r12414).

Also removed empty default constructor as unneeded.

src/Notes.cc
src/Notes.h

index 56d01c764603210cdc5a07e23a0c14f0924d5d05..1062f7fe993e3ab3531e3ebe4d35021e4cf0bbec 100644 (file)
@@ -132,6 +132,13 @@ Notes::clean()
     notes.clean();
 }
 
+
+NotePairs::~NotePairs()
+{
+    while (!entries.empty())
+        delete entries.pop_back();
+}
+
 const char *
 NotePairs::find(const char *noteKey) const
 {
index daa576864b45482e1dd166c184082eb6cee1b9fb..108cdcc1f55f1e2f4e6c44a24a7fce27c3f66b3f 100644 (file)
@@ -122,7 +122,7 @@ public:
         MEMPROXY_CLASS(Entry);
     };
 
-    NotePairs() {}
+    ~NotePairs();
 
     /**
      * Append the entries of the src NotePairs list to our list.