]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorMark Andrews <marka@isc.org>
Fri, 29 Mar 2002 01:35:24 +0000 (01:35 +0000)
committerMark Andrews <marka@isc.org>
Fri, 29 Mar 2002 01:35:24 +0000 (01:35 +0000)
1240.   [bug]           It was possible to leak zone references by
                        specifying an incorrect zone to rndc.

CHANGES
bin/named/server.c

diff --git a/CHANGES b/CHANGES
index 7f96b88291936379f991e1de8e33c5eb1928a647..db784eaf80a68c3b94bbd30b4f533d9fae403d74 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1240.  [bug]           It was possible to leak zone references by
+                       specifying an incorrect zone to rndc.
+
 1239.  [bug]           Under certain circumstances named could continue to
                        use a name after it had been freed triggering
                        INSIST() failures.  [RT #2614]
index 38612a4210ca8f280a3977a7f3da40d56b4332f1..5a4883d57f45e67fc670c15c194d050492b72aaa 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.339.2.4 2002/02/08 03:57:13 marka Exp $ */
+/* $Id: server.c,v 1.339.2.5 2002/03/29 01:35:24 marka Exp $ */
 
 #include <config.h>
 
@@ -2510,10 +2510,8 @@ zone_from_args(ns_server_t *server, char *args, dns_zone_t **zonep) {
 
        /* Look for the zone name. */
        zonetxt = next_token(&input, " \t");
-       if (zonetxt == NULL) {
-               *zonep = NULL;
+       if (zonetxt == NULL)
                return (ISC_R_SUCCESS);
-       }
 
        /* Look for the optional class name. */
        classtxt = next_token(&input, " \t");
@@ -2550,9 +2548,9 @@ zone_from_args(ns_server_t *server, char *args, dns_zone_t **zonep) {
        
        result = dns_zt_find(view->zonetable, dns_fixedname_name(&name),
                             0, NULL, zonep);
-       if (result != ISC_R_SUCCESS)
-               goto fail2;
- fail2:
+       /* Partial match? */
+       if (result != ISC_R_SUCCESS && *zonep != NULL)
+               dns_zone_detach(zonep);
        dns_view_detach(&view);
  fail1:
        return (result);