]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2020. [bug] rdataset_setadditional() could leak memory. [RT #16034]
authorMark Andrews <marka@isc.org>
Tue, 16 May 2006 04:11:39 +0000 (04:11 +0000)
committerMark Andrews <marka@isc.org>
Tue, 16 May 2006 04:11:39 +0000 (04:11 +0000)
CHANGES
lib/dns/rbtdb.c

diff --git a/CHANGES b/CHANGES
index f2846b233c1f4f875d46070cfeeae7420b0e3301..f4c0c664f7831a78a1bb2686ae1379ade8ea570c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+2020.  [bug]           rdataset_setadditional() could leak memory. [RT #16034]
+
 2019.  [tuning]        Reduce the amount of work performed per quantum
                        when cleaning the cache. [RT #15986]
 
index 2f689c2087ad93bec51d4a345ace1f1e3fbf7b8c..3afe4d105d8f3aa167cb265c1276bd7d749bab8c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbtdb.c,v 1.196.18.34 2006/05/02 12:55:31 shane Exp $ */
+/* $Id: rbtdb.c,v 1.196.18.35 2006/05/16 04:11:39 marka Exp $ */
 
 /*! \file */
 
@@ -6626,11 +6626,15 @@ rdataset_setadditional(dns_rdataset_t *rdataset, dns_rdatasetadditional_t type,
        return (ISC_R_SUCCESS);
 
   fail:
-       if (newentry != NULL) {
-               if (newcbarg != NULL)
+       if (newcbarg != NULL) {
+               if (newentry != NULL) {
                        acache_cancelentry(rbtdb->common.mctx, newentry,
                                           &newcbarg);
-               dns_acache_detachentry(&newentry);
+                       dns_acache_detachentry(&newentry);
+               }
+               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);