re: memory leak in -head

From: Adrian Chadd <adrian@dont-contact.us>
Date: Fri, 12 Jan 2001 03:08:45 +0800

Hi,

I'm not *entirely* sure that I can destroy the checklist there,
but it *seems* to work.

Can someone more fluent in the black magic ways of http and acl code
check it out and then give me an OK to commit it to -head ?

thanks!

Adrian

----- Forwarded message from Adrian Chadd <adrian@nympho.cacheboy.net> -----

Date: Thu, 11 Jan 2001 20:07:08 +0100 (CET)
From: Adrian Chadd <adrian@nympho.cacheboy.net>
To: adrian@creative.net.au

Index: HttpHeaderTools.c
===================================================================
RCS file: /cvsroot/squid/squid/src/HttpHeaderTools.c,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 HttpHeaderTools.c
--- HttpHeaderTools.c 2001/01/10 22:49:54 1.2.2.1
+++ HttpHeaderTools.c 2001/01/11 19:02:04
@@ -399,6 +399,8 @@
 int
 httpHdrMangle(HttpHeaderEntry * e, request_t * request)
 {
+ int retval;
+
     /* check with anonymizer tables */
     header_mangler *hm;
     aclCheck_t *checklist;
@@ -408,13 +410,17 @@
         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. */

----- End forwarded message -----

-- 
Adrian Chadd			"Sex Change: a simple job of outside 
<adrian@creative.net.au>	  to inside plumbing."
				    - Some random movie
Received on Thu Jan 11 2001 - 12:08:54 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:17 MST