]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
refcount errors on error paths
authorMark Andrews <marka@isc.org>
Tue, 31 Jul 2018 07:41:45 +0000 (17:41 +1000)
committerMark Andrews <marka@isc.org>
Tue, 31 Jul 2018 07:41:45 +0000 (17:41 +1000)
lib/dns/rbtdb.c
lib/dns/view.c

index e332802fc3e871f1b3d986c8c8e358c0a34f0a38..01c7cd85e236639d276992bf1ef1823438d5536a 100644 (file)
@@ -8368,7 +8368,6 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
                if (result != ISC_R_SUCCESS) {
                        while (i-- > 0) {
                                NODE_DESTROYLOCK(&rbtdb->node_locks[i].lock);
-                               isc_refcount_decrement(&rbtdb->node_locks[i].references, NULL);
                                isc_refcount_destroy(&rbtdb->node_locks[i].references);
                        }
                        goto cleanup_deadnodes;
@@ -8491,7 +8490,6 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
        rbtdb->current_version = allocate_version(mctx, 1, 1, ISC_FALSE);
        if (rbtdb->current_version == NULL) {
                isc_refcount_decrement(&rbtdb->references, NULL);
-               isc_refcount_destroy(&rbtdb->references);
                free_rbtdb(rbtdb, ISC_FALSE, NULL);
                return (ISC_R_NOMEMORY);
        }
@@ -8513,7 +8511,6 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
                            sizeof(*rbtdb->current_version));
                rbtdb->current_version = NULL;
                isc_refcount_decrement(&rbtdb->references, NULL);
-               isc_refcount_destroy(&rbtdb->references);
                free_rbtdb(rbtdb, ISC_FALSE, NULL);
                return (result);
        }
index e36576fd40ab384e17036a5121aaa5b51d1ee39a..775153504a3af63b6cf15ee1dbb3426c0f33e7b4 100644 (file)
@@ -311,6 +311,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
                dns_tsigkeyring_detach(&view->dynamickeys);
 
  cleanup_references:
+       isc_refcount_decrement(&view->references, NULL);
        isc_refcount_destroy(&view->references);
 
  cleanup_fwdtable: