[9.20] fix: dev: Use attach()/detach() functions instead of touching .references

In rbtdb.c, there were places where the code touched .references
directly instead of using the helper functions.  Use the helper
functions instead.

Forward port from https://gitlab.isc.org/isc-private/bind9/-/merge_requests/753

Merge branch 'ondrej/use-attach-detach-in-rbtdb-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9795
This commit is contained in:
Evan Hunt 2024-11-27 22:51:41 +00:00
commit 1e9c3af75a

View file

@ -1417,7 +1417,7 @@ dns__rbtdb_decref(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
UNUSED(refs);
#endif
if (KEEP_NODE(node, rbtdb, (locked || write_locked))) {
if (KEEP_NODE(node, rbtdb, locked || write_locked)) {
goto restore_locks;
}
@ -2030,7 +2030,7 @@ dns__rbtdb_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
sizeof(*changed));
}
if (rbtdb->loop != NULL) {
isc_refcount_increment(&rbtdb->common.references);
dns_db_attach((dns_db_t *)rbtdb, &(dns_db_t *){ NULL });
isc_async_run(rbtdb->loop, cleanup_dead_nodes_callback,
rbtdb);
} else {