]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Call aclChecklistFree() once we've done with the ACL. This means we don't
authoradrian <>
Fri, 12 Jan 2001 05:20:45 +0000 (05:20 +0000)
committeradrian <>
Fri, 12 Jan 2001 05:20:45 +0000 (05:20 +0000)
leak various bits and pieces.

src/HttpHeaderTools.cc

index c424691e665112eb76371c6a59afe793a58b5dac..480f1301247f4bf093e2a04e92a1de66593c4cf7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeaderTools.cc,v 1.28 2001/01/04 21:09:00 wessels Exp $
+ * $Id: HttpHeaderTools.cc,v 1.29 2001/01/11 22:20:45 adrian Exp $
  *
  * DEBUG: section 66    HTTP Header Tools
  * AUTHOR: Alex Rousskov
@@ -399,22 +399,27 @@ httpHeaderStrCmp(const char *h1, const char *h2, int len)
 int
 httpHdrMangle(HttpHeaderEntry * e, request_t * request)
 {
+    int retval;
+
     /* check with anonymizer tables */
     header_mangler *hm;
     aclCheck_t *checklist;
     assert(e);
     hm = &Config.header_access[e->id];
-    checklist = aclChecklistCreate(hm->access_list,
-       request, NULL);
+    checklist = aclChecklistCreate(hm->access_list, request, NULL);
     /* aclCheckFast returns 1 for allow. */
     if (1 == aclCheckFast(hm->access_list, checklist))
-       return 1;
+        retval = 1;
     /* It was denied; Do we replace it with something else? */
-    if (NULL == hm->replacement)
-       return 0;
+    else if (NULL == hm->replacement)
+        retval = 0;
     /* yes, we do */
-    stringReset(&e->value, hm->replacement);
-    return 1;
+    else
+        stringReset(&e->value, hm->replacement);
+    retval = 1;
+
+    aclChecklistFree(checklist);
+    return retval;
 }
 
 /* Mangles headers for a list of headers. */