]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add constructore/destructor for Mgr::ActionPasswordList
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 28 Oct 2012 05:25:21 +0000 (23:25 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 28 Oct 2012 05:25:21 +0000 (23:25 -0600)
Missing constructor for Mgr::ActionPasswordList resulted in invalid values
for next pointer and segmentation fault parsing multiple cachemgr_passwd
directives.

Missing destructor resulted in memory leaks on reconfigure and shutdown.

src/mgr/ActionPasswordList.cc
src/mgr/ActionPasswordList.h

index b480a4a80bdeafe9995ea2d94a501b44f1513454..5c34a0fb6647044a59c1a2c5ff711a86ac36b4af 100644 (file)
 
 #include "squid.h"
 #include "mgr/ActionPasswordList.h"
+#include "wordlist.h"
 
+Mgr::ActionPasswordList::~ActionPasswordList()
+{
+    safe_free(passwd);
+    wordlistDestroy(&actions);
+    delete next;
+}
index eba5a4335ff127fd9176b31b9a334a29d9ed3223..3e3ade7eee64227bacefcff316dac2b85cad8c3a 100644 (file)
@@ -38,6 +38,9 @@ namespace Mgr
 class ActionPasswordList
 {
 public:
+    ActionPasswordList() : passwd(NULL), actions(NULL), next(NULL) {}
+    ~ActionPasswordList();
+
     char *passwd;
     wordlist *actions;
     ActionPasswordList *next;