From: robertc <> Date: Wed, 11 Dec 2002 18:57:38 +0000 (+0000) Subject: clarify aclCheck_t freeing behaviour - thanks to --apb (Alan Barrett) X-Git-Tag: SQUID_3_0_PRE1~497 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=684596420ce7eadc65e6695227fed68a203d09ea;p=thirdparty%2Fsquid.git clarify aclCheck_t freeing behaviour - thanks to --apb (Alan Barrett) --- diff --git a/src/acl.cc b/src/acl.cc index 5687cd6fea..0e109c3dd5 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,5 +1,5 @@ /* - * $Id: acl.cc,v 1.293 2002/12/06 23:19:13 hno Exp $ + * $Id: acl.cc,v 1.294 2002/12/11 11:57:38 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -2079,6 +2079,24 @@ aclLookupExternalDone(void *data, void *result) aclCheck(checklist); } +/* + * Any aclCheck_t created by aclChecklistCreate() must eventually be + * freed by aclChecklistFree(). There are two common cases: + * + * A) Using aclCheckFast(): The caller creates the aclCheck_t using + * aclChecklistCreate(), checks it using aclCheckFast(), and frees it + * using aclChecklistFree(). + * + * B) Using aclNBCheck() and callbacks: The caller creates the + * aclCheck_t using aclChecklistCreate(), and passes it to + * aclNBCheck(). Control eventually passes to aclCheckCallback(), + * which will invoke the callback function as requested by the + * original caller of aclNBCheck(). This callback function must + * *not* invoke aclChecklistFree(). After the callback function + * returns, aclCheckCallback() will free the aclCheck_t using + * aclChecklistFree(). + */ + aclCheck_t * aclChecklistCreate(const acl_access * A, request_t * request, const char *ident) {