]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Memory leak on PconnPools
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 19 Feb 2009 02:17:28 +0000 (15:17 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 19 Feb 2009 02:17:28 +0000 (15:17 +1300)
Need to free the Pconn hash table properly.
constructor/desctructor are both required.

src/pconn.cc
src/pconn.h

index 1412083a1336a34eb2d5972b0920f68c9ed74a19..7243c4f495adcfb6a0202e28991cd2c4bab83839 100644 (file)
@@ -235,15 +235,19 @@ PconnPool::PconnPool(const char *aDescr) : table(NULL), descr(aDescr)
     for (i = 0; i < PCONN_HIST_SZ; i++)
         hist[i] = 0;
 
-    PconnModule::GetInstance()->add
-    (this);
+    PconnModule::GetInstance()->add(this);
+}
+
+PconnPool::~PconnPool()
+{
+    descr = NULL;
+    hashFreeMemory(table);
 }
 
 void
 
 PconnPool::push(int fd, const char *host, u_short port, const char *domain, struct IN_ADDR *client_address)
 {
-
     IdleConnList *list;
     const char *aKey;
     LOCAL_ARRAY(char, desc, FD_DESC_SZ);
index 98f7ae286a0737165708bd315d43fda83d8d4153..1bff65f14aa86acca2bda8887f7b8d07de72a903 100644 (file)
@@ -46,6 +46,7 @@ class PconnPool
 
 public:
     PconnPool(const char *);
+    ~PconnPool();
 
     void moduleInit();
     void push(int fd, const char *host, u_short port, const char *domain, struct IN_ADDR *client_address);