From: Amos Jeffries Date: Sun, 28 Oct 2012 05:25:21 +0000 (-0600) Subject: Add constructore/destructor for Mgr::ActionPasswordList X-Git-Tag: SQUID_3_3_0_2~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c87dfa68ba27a1305dd765c39ec338f1208482d5;p=thirdparty%2Fsquid.git 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. --- 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;