REQUIRE(rbtdb->future_version == NULL);
if (rbtdb->current_version != NULL) {
- isc_refcount_decrementz(&rbtdb->current_version->references);
UNLINK(rbtdb->open_versions, rbtdb->current_version, link);
isc_rwlock_destroy(&rbtdb->current_version->glue_rwlock);
+ isc_refcount_decrementz(&rbtdb->current_version->references);
isc_refcount_destroy(&rbtdb->current_version->references);
isc_rwlock_destroy(&rbtdb->current_version->rwlock);
isc_mem_put(rbtdb->common.mctx, rbtdb->current_version,
result = isc_rwlock_init(&version->glue_rwlock, 0, 0);
if (result != ISC_R_SUCCESS) {
+ isc_refcount_decrementz(&version->references);
isc_refcount_destroy(&version->references);
isc_mem_put(mctx, version, sizeof(*version));
return (NULL);
if (result != ISC_R_SUCCESS) {
free_gluetable(version);
isc_rwlock_destroy(&version->glue_rwlock);
+ isc_refcount_decrementz(&version->references);
isc_refcount_destroy(&version->references);
isc_mem_put(rbtdb->common.mctx, version,
sizeof(*version));
REQUIRE(VALID_RBTDB(rbtdb));
version = (rbtdb_version_t *)*versionp;
+ *versionp = NULL;
INSIST(version->rbtdb == rbtdb);
cleanup_version = NULL;
INSIST(!version->writer);
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
}
- goto end;
+ return;
}
/*
RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_write);
}
}
-
-end:
- *versionp = NULL;
}
/*
rbtdb->current_serial = 1;
rbtdb->least_serial = 1;
rbtdb->next_serial = 2;
+ ISC_LIST_INIT(rbtdb->open_versions);
rbtdb->current_version = allocate_version(mctx, 1, 1, false);
if (rbtdb->current_version == NULL) {
isc_refcount_decrementz(&rbtdb->references);
if (result != ISC_R_SUCCESS) {
free_gluetable(rbtdb->current_version);
isc_rwlock_destroy(&rbtdb->current_version->glue_rwlock);
+ isc_refcount_decrementz(&rbtdb->current_version->references);
isc_refcount_destroy(&rbtdb->current_version->references);
isc_mem_put(mctx, rbtdb->current_version,
sizeof(*rbtdb->current_version));
rbtdb->current_version->records = 0;
rbtdb->current_version->xfrsize = 0;
rbtdb->future_version = NULL;
- ISC_LIST_INIT(rbtdb->open_versions);
/*
* Keep the current version in the open list so that list operation
* won't happen in normal lookup operations.