From: Alex Rousskov Date: Fri, 17 May 2013 23:05:23 +0000 (-0600) Subject: Avoid annotation leaks by properly destroying NotePairs entries. X-Git-Tag: SQUID_3_4_0_1~129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b670cb6ab0bf9efd75d0375f0e28d38d56c70931;p=thirdparty%2Fsquid.git Avoid annotation leaks by properly destroying NotePairs entries. The leak was added with the "note" directive (r12414). Also removed empty default constructor as unneeded. --- diff --git a/src/Notes.cc b/src/Notes.cc index 56d01c7646..1062f7fe99 100644 --- a/src/Notes.cc +++ b/src/Notes.cc @@ -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 { diff --git a/src/Notes.h b/src/Notes.h index daa576864b..108cdcc1f5 100644 --- a/src/Notes.h +++ b/src/Notes.h @@ -122,7 +122,7 @@ public: MEMPROXY_CLASS(Entry); }; - NotePairs() {} + ~NotePairs(); /** * Append the entries of the src NotePairs list to our list.