2442. [bug] A lock could be destroyed twice. [RT# 18626]

This commit is contained in:
Mark Andrews
2008-09-14 04:54:49 +00:00
parent 6011ef0f4d
commit 896f88361e
2 changed files with 8 additions and 4 deletions
+2
View File
@@ -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]
+6 -4
View 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;
}