From f76247e9754ca73793ede3a067c729d36343ce2b Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 23 Oct 2012 00:46:00 +1300 Subject: [PATCH] Add constructore/destructor for Mgr::ActionPasswordList 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 | 7 +++++++ src/mgr/ActionPasswordList.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/mgr/ActionPasswordList.cc b/src/mgr/ActionPasswordList.cc index b480a4a80b..5c34a0fb66 100644 --- a/src/mgr/ActionPasswordList.cc +++ b/src/mgr/ActionPasswordList.cc @@ -29,4 +29,11 @@ #include "squid.h" #include "mgr/ActionPasswordList.h" +#include "wordlist.h" +Mgr::ActionPasswordList::~ActionPasswordList() +{ + safe_free(passwd); + wordlistDestroy(&actions); + delete next; +} diff --git a/src/mgr/ActionPasswordList.h b/src/mgr/ActionPasswordList.h index eba5a4335f..3e3ade7eee 100644 --- a/src/mgr/ActionPasswordList.h +++ b/src/mgr/ActionPasswordList.h @@ -38,6 +38,9 @@ namespace Mgr class ActionPasswordList { public: + ActionPasswordList() : passwd(NULL), actions(NULL), next(NULL) {} + ~ActionPasswordList(); + char *passwd; wordlist *actions; ActionPasswordList *next; -- 2.47.3