]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Tue, 25 Jul 2000 22:47:39 +0000 (22:47 +0000)
committerAndreas Gustafsson <source@isc.org>
Tue, 25 Jul 2000 22:47:39 +0000 (22:47 +0000)
 350.   [bug]           Also-notify lists specified in the global options
                        block were not correctly reference counted, causing
                        a memory leak.

CHANGES
lib/dns/config/confview.c
lib/dns/config/confzone.c
lib/dns/zoneconf.c

diff --git a/CHANGES b/CHANGES
index 6f9c8186fbb1e92869a9f1190d1e683967f60338..5a6e5aa2e26c05eb01df32d5c8718ec8d993510f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,8 @@
 
+ 350.  [bug]           Also-notify lists specified in the global options
+                       block were not correctly reference counted, causing
+                       a memory leak.
+
  344.  [bug]           When shutting down, lwresd sometimes tried
                        to shut down its client tasks twice, 
                        triggering an assertion.
index d06a57ced1b6c309c316666e031bfb434e5f59eb..ebe189cac84a2ea404654250fe7b9176c09d38a8 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: confview.c,v 1.36 2000/06/09 22:13:23 brister Exp $ */
+/* $Id: confview.c,v 1.36.2.1 2000/07/25 22:47:37 gson Exp $ */
 
 #include <config.h>
 
@@ -1052,10 +1052,12 @@ dns_c_view_getalsonotify(dns_c_view_t *view,
 {
        REQUIRE(DNS_C_VIEW_VALID(view));
        REQUIRE(ipl != NULL);
-       
-       *ipl = view->also_notify;
 
-       return (*ipl == NULL ? ISC_R_NOTFOUND : ISC_R_SUCCESS);
+       if (view->also_notify == NULL)
+               return (ISC_R_NOTFOUND);
+
+       dns_c_iplist_attach(view->also_notify, ipl);
+       return (ISC_R_SUCCESS);
 }
 
 
index 057ff831ec84d06c9c867e83b9ce6b71a1b4e960..0ce89971be2fb4c46465fe91ae8167aff1820e8c 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: confzone.c,v 1.47 2000/06/05 09:17:09 brister Exp $ */
+/* $Id: confzone.c,v 1.47.2.1 2000/07/25 22:47:39 gson Exp $ */
 
 #include <config.h>
 
@@ -1665,7 +1665,7 @@ dns_c_zone_getalsonotify(dns_c_zone_t *zone, dns_c_iplist_t **retval) {
        }
 
        if (p != NULL) {
-               *retval = p;
+               dns_c_iplist_attach(p, retval);
                res = ISC_R_SUCCESS;
        } else {
                res = ISC_R_NOTFOUND;
index ab0702384b5e0721f216b63e7f16250e10c579d3..b3bbcc580bf1233c2a4fb834d989a1c22533b5e7 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: zoneconf.c,v 1.43 2000/06/22 21:54:57 tale Exp $ */
+/* $Id: zoneconf.c,v 1.43.2.1 2000/07/25 22:47:35 gson Exp $ */
 
 #include <config.h>
 
@@ -189,10 +189,14 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview,
                        result = dns_c_view_getalsonotify(cview, &iplist);
                if (result != ISC_R_SUCCESS)
                        result = dns_c_ctx_getalsonotify(cctx, &iplist);
-               if (result == ISC_R_SUCCESS)
-                       RETERR(dns_zone_setalsonotify(zone, iplist->ips,
-                                                     iplist->nextidx));
-               else
+               if (result == ISC_R_SUCCESS) {
+                       result = dns_zone_setalsonotify(zone, iplist->ips,
+                                                       iplist->nextidx);
+                       dns_c_iplist_detach(&iplist);
+                       if (result != ISC_R_SUCCESS)
+                               return (result);
+
+               } else
                        RETERR(dns_zone_setalsonotify(zone, NULL, 0));
                
                RETERR(configure_zone_acl(czone, cctx, cview, ac, zone,