]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2046. [bug] rbtdb.c:rdataset_setadditional() could cause duplicate
authorTatuya JINMEI 神明達哉 <jinmei@isc.org>
Thu, 6 Jul 2006 06:36:51 +0000 (06:36 +0000)
committerTatuya JINMEI 神明達哉 <jinmei@isc.org>
Thu, 6 Jul 2006 06:36:51 +0000 (06:36 +0000)
cleanup.

CHANGES
lib/dns/rbtdb.c

diff --git a/CHANGES b/CHANGES
index d4215627a0b6088c59a9e91e00bc1163e698a67d..b689247dcabe7ef633695d6e5edc3707d3f59207 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2046.  [bug]           rbtdb.c:rdataset_setadditional() could cause duplicate
+                       cleanup.
+
 2045.  [func]          use lock buckets for acache entries to limit memory
                        consumption. [RT #16183]
 
index c6aa830349d5ae9e524745c1cf0b1b8cc32d6b3e..5093d5d734a17c36295939972d6a9bdf99e2a38f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbtdb.c,v 1.235 2006/06/13 04:49:18 marka Exp $ */
+/* $Id: rbtdb.c,v 1.236 2006/07/06 06:36:51 jinmei Exp $ */
 
 /*! \file */
 
@@ -6629,10 +6629,12 @@ rdataset_setadditional(dns_rdataset_t *rdataset, dns_rdatasetadditional_t type,
                        acache_cancelentry(rbtdb->common.mctx, newentry,
                                           &newcbarg);
                        dns_acache_detachentry(&newentry);
+               } else {
+                       dns_db_detachnode((dns_db_t *)rbtdb, &newcbarg->node);
+                       dns_db_detach(&newcbarg->db);
+                       isc_mem_put(rbtdb->common.mctx, newcbarg,
+                           sizeof(*newcbarg));
                }
-               dns_db_detachnode((dns_db_t *)rbtdb, &newcbarg->node);
-               dns_db_detach(&newcbarg->db);
-               isc_mem_put(rbtdb->common.mctx, newcbarg, sizeof(*newcbarg));
        }
 
        return (result);