]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pull up windows acl leak fix from 9.5.0-P2-W1
authorEvan Hunt <each@isc.org>
Wed, 10 Sep 2008 21:52:49 +0000 (21:52 +0000)
committerEvan Hunt <each@isc.org>
Wed, 10 Sep 2008 21:52:49 +0000 (21:52 +0000)
CHANGES
lib/dns/acl.c
lib/dns/iptable.c

diff --git a/CHANGES b/CHANGES
index f90e050b191cca82a3c525db0b8ce807b5734cd7..bee0fb3f0676ada8fbfc78b910bb59ab584a8493 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+2435.  [bug]           Fixed an ACL memory leak affecting win32.
+
 2434.  [placeholder]
 
 2433.  [tuning]        Set initial timeout to 800ms.
index 533df2ebca65d041f1dc753ec8bacb01bdf76f99..edb91b328c12c9c4219d1a565872858a1ff0c3c2 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: acl.c,v 1.45 2008/04/29 01:01:42 each Exp $ */
+/* $Id: acl.c,v 1.46 2008/09/10 21:52:49 each Exp $ */
 
 /*! \file */
 
@@ -234,8 +234,10 @@ dns_acl_match(const isc_netaddr_t *reqaddr,
                dns_aclelement_t *e = &acl->elements[i];
 
                /* Already found a better match? */
-               if (match_num != -1 && match_num < e->node_num)
+               if (match_num != -1 && match_num < e->node_num) {
+                       isc_refcount_destroy(&pfx.refcount);
                        return (ISC_R_SUCCESS);
+               }
 
                if (dns_aclelement_match(reqaddr, reqsigner,
                                         e, env, matchelt)) {
@@ -245,10 +247,12 @@ dns_acl_match(const isc_netaddr_t *reqaddr,
                                else
                                        *match = e->node_num;
                        }
+                       isc_refcount_destroy(&pfx.refcount);
                        return (ISC_R_SUCCESS);
                }
        }
 
+       isc_refcount_destroy(&pfx.refcount);
        return (ISC_R_SUCCESS);
 }
 
index 80587689ffcf6727b3374da6f8bef2b6635d3e97..475357a54d22d4223220b6d2eaa1a9f1132757ed 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: iptable.c,v 1.10 2008/08/27 04:44:18 marka Exp $ */
+/* $Id: iptable.c,v 1.11 2008/09/10 21:52:49 each Exp $ */
 
 #include <isc/mem.h>
 #include <isc/radix.h>
@@ -75,8 +75,10 @@ dns_iptable_addprefix(dns_iptable_t *tab, isc_netaddr_t *addr,
 
        result = isc_radix_insert(tab->radix, &node, NULL, &pfx);
 
-       if (result != ISC_R_SUCCESS)
+       if (result != ISC_R_SUCCESS) {
+               isc_refcount_destroy(&pfx.refcount);
                return(result);
+       }
 
        /* If the node already contains data, don't overwrite it */
        if (node->data[ISC_IS6(family)] == NULL) {
@@ -86,6 +88,7 @@ dns_iptable_addprefix(dns_iptable_t *tab, isc_netaddr_t *addr,
                        node->data[ISC_IS6(family)] = &dns_iptable_neg;
        }
 
+       isc_refcount_destroy(&pfx.refcount);
        return (ISC_R_SUCCESS);
 }