Commit b6d496d5 authored by Evan Hunt's avatar Evan Hunt
Browse files

Fix memory leak with "any" and "none" ACLs [RT #17272]

parent a3553875
2261. [bug] Fix memory leak with "any" and "none" ACLs [RT #17272]
2260. [bug] Reported wrong clients-per-query when increasing the 2260. [bug] Reported wrong clients-per-query when increasing the
value. [RT #17236] value. [RT #17236]
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: aclconf.c,v 1.14 2007/10/19 00:28:20 each Exp $ */ /* $Id: aclconf.c,v 1.15 2007/11/19 23:13:28 each Exp $ */
#include <config.h> #include <config.h>
...@@ -299,14 +299,28 @@ cfg_acl_fromconfig(const cfg_obj_t *caml, ...@@ -299,14 +299,28 @@ cfg_acl_fromconfig(const cfg_obj_t *caml,
const char *name = cfg_obj_asstring(ce); const char *name = cfg_obj_asstring(ce);
if (strcasecmp(name, "any") == 0) { if (strcasecmp(name, "any") == 0) {
/* iptable entry with zero bit length */ /* iptable entry with zero bit length */
dns_iptable_addprefix(iptab, NULL, 0, result = dns_iptable_addprefix(iptab, NULL, 0,
ISC_TRUE); ISC_TF(nest_level != 0 || !neg));
continue; if (result != ISC_R_SUCCESS)
goto cleanup;
if (nest_level != 0) {
de->type = dns_aclelementtype_nestedacl;
de->negative = neg;
} else
continue;
} else if (strcasecmp(name, "none") == 0) { } else if (strcasecmp(name, "none") == 0) {
/* negated "any" */ /* negated "any" */
dns_iptable_addprefix(iptab, NULL, 0, result = dns_iptable_addprefix(iptab, NULL, 0,
ISC_FALSE); ISC_TF(nest_level != 0 || neg));
continue; if (result != ISC_R_SUCCESS)
goto cleanup;
if (nest_level != 0) {
de->type = dns_aclelementtype_nestedacl;
de->negative = !neg;
} else
continue;
} else if (strcasecmp(name, "localhost") == 0) { } else if (strcasecmp(name, "localhost") == 0) {
de->type = dns_aclelementtype_localhost; de->type = dns_aclelementtype_localhost;
de->negative = neg; de->negative = neg;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment