]> 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:43:26 +0000 (06:43 +0000)
committerTatuya JINMEI 神明達哉 <jinmei@isc.org>
Thu, 6 Jul 2006 06:43:26 +0000 (06:43 +0000)
cleanup [RT #16247].

CHANGES
lib/dns/rbtdb.c

diff --git a/CHANGES b/CHANGES
index 46c16b3a76f5cc8cf420c7b78fe78fd9c84eb2bb..da997f3500e17ec9959e23f99aa1eb03da2d24f2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2046.  [bug]           rbtdb.c:rdataset_setadditional() could cause duplicate
+                       cleanup [RT #16247].
+
 2044.  [port]          add support for atomic operations for Itanium.
                        [RT #16179]
 
index ce38d5814bef7ff589f6fddada81064612e3fd2b..91ba5208cf3ae9372c1a4a1806971bb58bba9576 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbtdb.c,v 1.196.18.37 2006/06/13 04:54:39 marka Exp $ */
+/* $Id: rbtdb.c,v 1.196.18.38 2006/07/06 06:43:26 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);