]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2442. [bug] A lock could be destroyed twice. [RT# 18626]
authorMark Andrews <marka@isc.org>
Sun, 14 Sep 2008 04:54:49 +0000 (04:54 +0000)
committerMark Andrews <marka@isc.org>
Sun, 14 Sep 2008 04:54:49 +0000 (04:54 +0000)
CHANGES
lib/isc/radix.c

diff --git a/CHANGES b/CHANGES
index 03799b2686f43a680874bf4970f5a2984c362e46..cb393de8729414c7aec82fd34f1f30da8fc409ec 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+2442.  [bug]           A lock could be destroyed twice. [RT# 18626]
+
 2441.   [bug]           isc_radix_insert() could copy radix tree nodes
                        incompletely. [RT #18573]
 
index 19c0e8c5f304ed8823b5e28e3cbfce357d00bb84..367138639892b238904ca3c69295dba09bd8d14e 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: radix.c,v 1.17 2008/09/12 23:47:25 tbox Exp $ */
+/* $Id: radix.c,v 1.18 2008/09/14 04:54:49 marka Exp $ */
 
 /*
  * This source was adapted from MRT's RCS Ids:
@@ -98,13 +98,15 @@ _ref_prefix(isc_mem_t *mctx, isc_prefix_t **target, isc_prefix_t *prefix) {
               (prefix->family == AF_INET6 && prefix->bitlen <= 128));
        REQUIRE(target != NULL);
 
-       /* If this prefix is a static allocation, copy it into new memory */
+       /*
+        * If this prefix is a static allocation, copy it into new memory.
+        * (Note, the refcount still has to be destroyed by the calling
+        * routine.)
+        */
        if (isc_refcount_current(&prefix->refcount) == 0) {
                isc_result_t ret;
                ret = _new_prefix(mctx, target, prefix->family,
                                  &prefix->add, prefix->bitlen);
-               if (ret == ISC_R_SUCCESS)
-                       isc_refcount_destroy(&prefix->refcount);
                return ret;
        }